| Author |
Message |
Asgard Junior Developer
Joined: 15 Dec 2007 Posts: 16
|
Posted: Sun Dec 16, 2007 9:50 pm Post subject: |
|
|
Hello, plusminus. Thanks for your help
All the ways described above works fine, but I would like to play sound from project res folder, as in your example. _________________ Catch the moment |
|
| Back to top |
|
 |
plusminus Site Admin

Joined: 14 Nov 2007 Posts: 2067 Location: Germany
|
Posted: Sun Dec 16, 2007 10:05 pm Post subject: |
|
|
Hm,
there is no other solution to load from resource that I am aware of...
Please post your code and OS/SDK/ADT-VErsions ( are you using the new SDK (released yersterday ) )
Perhaps someone recognizes the he/she had the same problem and answers.
Regards,
plusminus _________________
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
cybersat Freshman
Joined: 18 Dec 2007 Posts: 5
|
Posted: Tue Dec 18, 2007 12:24 pm Post subject: Can't hear |
|
|
Installed music player file and program is working , but i can't hear mp3.
I had increased volume in emulator, still no sound. |
|
| Back to top |
|
 |
plusminus Site Admin

Joined: 14 Nov 2007 Posts: 2067 Location: Germany
|
Posted: Tue Dec 18, 2007 3:44 pm Post subject: |
|
|
Hello cybersat,
did you hear the sound the emulator makes when hitting the VolumeUp/Down Buttons
did you run the emulator with "-useaudio"
Regards,
plusminus _________________
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
Katharnavas Senior Developer
Joined: 04 Dec 2007 Posts: 100 Location: India
|
Posted: Wed Dec 19, 2007 5:05 am Post subject: |
|
|
I hope he is missing that atleast when volume key is pressed he will hear a music.
| plusminus wrote: | Hello cybersat,
did you hear the sound the emulator makes when hitting the VolumeUp/Down Buttons
did you run the emulator with "-useaudio"
Regards,
plusminus |
|
|
| Back to top |
|
 |
NumBeast Freshman
Joined: 09 Dec 2007 Posts: 6
|
Posted: Wed Dec 19, 2007 5:19 am Post subject: SOLUTION!!!! |
|
|
I have finally figured out why none of my mp3s were playing. They were not Mp3s. The files I were trying to play were Mono/22050Hz/64kbps/MPEG-1layer2 with the /mp3 extension. reformatting MPEG-1layer3 solves all my problems. YAY!!!!!!  |
|
| Back to top |
|
 |
R4 Freshman
Joined: 19 Dec 2007 Posts: 3
|
Posted: Wed Dec 19, 2007 9:37 am Post subject: |
|
|
Hello,
Similar symptoms to everyone else but in my case the problem was that the mp3 file was too big. The debugger log window showed this message:
| Code: | | D/asset(555): Data exceeds UNCOMPRESS_DATA_MAX (11960997 vs 1048576) |
Simply changing to a smaller (<1M) mp3 file solved the problem. No source code changes to the original at all.
R4 |
|
| Back to top |
|
 |
plusminus Site Admin

Joined: 14 Nov 2007 Posts: 2067 Location: Germany
|
Posted: Wed Dec 19, 2007 6:29 pm Post subject: |
|
|
Hello R4,
Yes exactly 1 MB ( == 1.048.576 Bytes )
Why ever they chose that limit ...
Regards,
plusminus _________________
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
gcameo Once Poster
Joined: 20 Dec 2007 Posts: 1
|
Posted: Thu Dec 20, 2007 5:46 pm Post subject: APPLICATION CANNOT BE FOUND |
|
|
After watching the screencast and following the tutorials evrything worked fine but the i could not find the application in the emulator.
I must mention that I did it from commandprompt since I dont have eclipse. Is there a plugin for netbeans |
|
| Back to top |
|
 |
ramgraph1 Experienced Developer
Joined: 09 Jan 2008 Posts: 68
|
Posted: Fri Jan 11, 2008 5:55 am Post subject: |
|
|
Is there a way to stop all audio that an activity is running when you quit it? I have a looping mp3 that just keeps playing when I quit and I need to know how to kill it!
Anybody know how?
Thanks |
|
| Back to top |
|
 |
plusminus Site Admin

Joined: 14 Nov 2007 Posts: 2067 Location: Germany
|
Posted: Fri Jan 11, 2008 11:03 am Post subject: |
|
|
Hello ramgraph,
you somewhere created a MediaPlayer object and you can use its stop()-method. Is it not working properly
Regards,
plusminus _________________
| Android Development Community / Tutorials |
|
| Back to top |
|
 |
ramgraph1 Experienced Developer
Joined: 09 Jan 2008 Posts: 68
|
Posted: Fri Jan 11, 2008 2:09 pm Post subject: |
|
|
Thanks for responding. I did create a MediaPlayer object but the use of it seems limited to the public void in which I created it so that to access the MediaPlayer I need to call that void again which just creates a new MediaPlayer, it seems. The code UI use is similar to your example above:
| Code: | public void onClick(View arg0) {
MediaPlayer mp = MediaPlayer.create(MusicPlayer.this,
R.raw.everlast);
mp.prepare();
mp.start(); |
except instead of setOnCompletionListener I am looping the audio. If I try to use "mp.stop();" from somewhere outside of the onClick where is was created I get "mp cannot be resolved". What code would you use to use another button to stop the audio you start in the code above? Thanks for any light you can shed! |
|
| Back to top |
|
 |
AndreySerj Junior Developer
Joined: 26 Dec 2007 Posts: 23 Location: Minsk
|
Posted: Thu Jan 17, 2008 11:52 am Post subject: |
|
|
Hi All,
While player is running I try to adjust a sound volume by buttons on emulator (on the right side), but nothing happens. How to control a sound volume on device ? |
|
| Back to top |
|
 |
plusminus Site Admin

Joined: 14 Nov 2007 Posts: 2067 Location: Germany
|
|
| Back to top |
|
 |
AndreySerj Junior Developer
Joined: 26 Dec 2007 Posts: 23 Location: Minsk
|
Posted: Fri Jan 18, 2008 9:19 am Post subject: |
|
|
| plusminus wrote: |
Ringing on incoming Voice-Calls works fine for me (changing the volume while its ringing works also) ....
|
Hi plusminus, I mean an audio volume control while playback ...
I found the following solution:
| Java: |
...
AudioSystem.setVolume(AudioSystem.STREAM_MUSIC, AudioSystem.MAX_VOLUME - step);
...
|
It work, but when I increase/decrease sound volume by right-side buttons on the emulator I hear both my audio playback and emulator-specific tone. |
|
| Back to top |
|
 |
|