4

I am building an app using App Inventor in which I need to play some sounds on button click. When I click button once it gives me

error 703: unable to play file

But on the next time, the sound is played.
Can anyone help me with this error?

Prashant Kumar
  • 20,069
  • 14
  • 47
  • 63
ahuja007
  • 103
  • 1
  • 3
  • 10

2 Answers2

3

Done it. I just initialized sound component with every file at screen initialize. Now its working fine.

ahuja007
  • 103
  • 1
  • 3
  • 10
  • 1
    exactly. [This workaround you also can find in the App Inventor forum](https://groups.google.com/d/msg/programming-with-app-inventor/Vk0QQhTPyxo/8cd6DEW2QC8J) – Taifun Dec 01 '13 at 13:23
-1

Try the below code,it works fine for me.

Uri b = Uri.parse(uri);
MediaPlayer mp = MediaPlayer.create(context,b);             
mp.start(); 
Simson
  • 3,373
  • 2
  • 24
  • 38
user3009917
  • 113
  • 9