Request to Replace the steps Section 9 AudioPlayer
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
I have tried a lot other solutions as well and I am getting in the end the same error
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
and this is the code I am using :
import 'package:flutter/material.dart';
import 'package:audioplayers/audioplayers.dart';
void main() => runApp(XylophoneApp());
class XylophoneApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Center(
child: TextButton(
onPressed: () async {
final player = AudioPlayer();
await player.play(
AssetSource('note1.wav'),
);
},
child: Text("Play me"),
),
),
),
),
);
}
}
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"),
),
),
),
),
);
}
}
Today I tried to run this code, and it works ! but before that , I went to the folder asset/note1.wav , and I double click on that then I run flutter , and clicked , and PINNNNNNNN , it works !!!!!