Error playing .wav files in Visual Studio

negar tavakol 0 Reputation points
2023-09-27T19:40:52.34+00:00

hey

i try to play wav. file in visual studio ,but that file can not play.how can fix that

void playSound(int soundNumber) {
    final player = AudioPlayer();
    player.setSource(AssetSource('note$soundNumber.wav'));
  }
 TextButton(
              
                child: const Text(
                  'click me',
                  style: TextStyle(
                    backgroundColor: Colors.red,
                    color: Colors.black,
                  ),
                ),
             
              onPressed: () {
                playSound(1);
              },
Microsoft Security | Intune | Microsoft Intune Android
0 comments No comments
{count} votes

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.