From 929ebb59f77f825da6bdd524a9d455d48f74ed52 Mon Sep 17 00:00:00 2001 From: Milad Zarour <50852900+MiladZarour@users.noreply.github.com> Date: Sat, 10 Dec 2022 19:42:14 +0100 Subject: [PATCH 1/2] Request to delete the steps , it is not working I am getting this error I/zygote ( 9419): Do partial code cache collection, code=17KB, data=21KB I/zygote ( 9419): After code cache collection, code=17KB, data=21KB I/zygote ( 9419): Increasing code cache capacity to 128KB D/EGL_emulation( 9419): eglMakeCurrent: 0xdc304780: ver 2 0 (tinfo 0xdc3038e0) V/MediaPlayer( 9419): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer( 9419): cleanDrmObj: mDrmObj=null mDrmSessionId=null V/MediaPlayer( 9419): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer( 9419): cleanDrmObj: mDrmObj=null mDrmSessionId=null V/MediaPlayer( 9419): resetDrmState: mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false V/MediaPlayer( 9419): cleanDrmObj: mDrmObj=null mDrmSessionId=null --- README.md | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/README.md b/README.md index b5cf8d9..4340fb8 100644 --- a/README.md +++ b/README.md @@ -196,49 +196,7 @@ ##### [Go back to Index](#index) -- Getting a lengthy error when trying to use **`audioplayers` plugin**? - - - All you need to do is open **`android > build.gradle` (Project Level `gradle` file)** - - - Inside **`buildscript {}`**, you'll find **`ext.kotlin_version` (Line 2 in file)** - - - Replace whatever version it is with [**Latest Stable Kotlin Version**](https://kotlinlang.org/docs/releases.html#release-details) - - - As of **July 23, 2021** it is, **`ext.kotlin_version = '1.5.21'`** - - - Now, **re-install** the app. If it's already running, press **Stop** then press **Run (Play)** again. - -- **`FlatButton`** is **`deprecated`**, so use **`TextButton`** instead. - -- By the end, the implementation of your **`TextButton`** should look like this: - - ```dart - @override - Widget build(BuildContext context) { - return Expanded( - child: TextButton( - style: ButtonStyle( - backgroundColor: MaterialStateProperty.all(color), - ), - onPressed: () { - playSound(soundNumber); - }, - ), - ); - } - ``` - - - **`AudioCache`** is **`deprecated`**, so use **`AudioPlayer`** instead. - - By the end, your solution to playing the audio should look like this: - ```dart - void playSound(int soundNumber) { - final player = AudioPlayer(); - player.setSource(AssetSource('note$soundNumber.wav')); - } - ``` - -- An example of a working project as of 16/07/2022 has been linked below: - - [Link to repository](https://github.com/vpatel-dev/xylophone-flutter) +-THAT SECTION SOLUTION IS NOT WORKING ## Section 10 : Quizzler App (Lesson 94) From ec3e3cc8f7ac3b7dd4d1719b917cfebbe7de8127 Mon Sep 17 00:00:00 2001 From: Milad Zarour <50852900+MiladZarour@users.noreply.github.com> Date: Sun, 11 Dec 2022 09:50:41 +0100 Subject: [PATCH 2/2] updated Section 9 that update it worked with me today --- README.md | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4340fb8..94fe86c 100644 --- a/README.md +++ b/README.md @@ -196,7 +196,44 @@ ##### [Go back to Index](#index) --THAT SECTION SOLUTION IS NOT WORKING +- Getting a lengthy error when trying to use **`audioplayers` plugin**? + +- first you need to play the sound from "asset/note1.wav" + +- Then you can copy paste this code : + +```dart +import 'package:flutter/material.dart'; +import 'package:audioplayers/audioplayers.dart'; + +void main() => runApp(XylophoneApp()); + +class XylophoneApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + final player = AudioPlayer(); + + return MaterialApp( + home: Scaffold( + body: SafeArea( + child: Center( + child: TextButton( + onPressed: () async { + await player.play(AssetSource('note1.wav')); + }, + child: Text("Click me"), + ), + ), + ), + ), + ); + } +} +``` +- after that start your programe , it should work + +- **`AudioCache`** is **`deprecated`**, so use **`AudioPlayer`** instead. + ## Section 10 : Quizzler App (Lesson 94)