Home > other >  The argument type 'String' can't be assigned to the parameter type 'Source'
The argument type 'String' can't be assigned to the parameter type 'Source'

Time:01-24

my error

I've been trying to play a simple audio file since one day but I couldn't

CodePudding user response:

You cannot play from a string. You can play from an AssetSource though:

oynitici.play(AssetSource('assets/clap1.wav'));

CodePudding user response:

Try:

oynitici.setAssets("assets/clap1.wav");
oynitici.play();
  • Related