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 Intune Android
Microsoft Intune Android
Microsoft Intune: A Microsoft cloud-based management solution that offers mobile device management, mobile application management, and PC management capabilities.Android: An open-source mobile platform based on the Linux kernel, developed by Google, and maintained by the Open Handset Alliance.
280 questions
0 comments No comments
{count} votes

Your answer

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