<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Playing Audio files on J2ME on 7925/7926</title>
  <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=5367944" />
  <subtitle>Playing Audio files on J2ME on 7925/7926</subtitle>
  <id>http://developer.cisco.com/c/message_boards/find_thread?p_l_id=&amp;threadId=5367944</id>
  <updated>2013-05-24T03:21:35Z</updated>
  <dc:date>2013-05-24T03:21:35Z</dc:date>
  <entry>
    <title>Playing Audio files on J2ME on 7925/7926</title>
    <link rel="alternate" href="http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=5367943" />
    <author>
      <name>Trevor Rowe</name>
    </author>
    <id>http://developer.cisco.com/c/message_boards/find_message?p_l_id=&amp;messageId=5367943</id>
    <updated>2012-03-28T17:42:33Z</updated>
    <published>2012-03-28T17:41:05Z</published>
    <summary type="html">Hi,
 
Has anybody managed to successfully play audio files in J2ME on the 7925/7926.
 
The best I've managed is to have the files playing at twice the speed they should be. Changing the rates etc doesn't seem to slow the playback to the correct speed, of course everything works fine in the emulator but not on the device
 
To play the file, I simply use
 
Player p = Manager.createPlayer("http://&lt;my file&gt;.wav");
p.start();
 
According to VLC, the details of the audio file are
 
Codec: PCM S16 LE (araw)
Channels: Mono
Sample Rate: 8000 Hz
Bits Per Sample: 16
 
The documentation at http://developer.cisco.com/c/document_library/get_file?groupId=2371349&amp;folderId=2378769&amp;name=97114 reads 
 
Max audio data size of 250 (javax.microedition. Kbytes media) Down-sampled to 8kS/s, mono before playback
Only supported content types:
- RAW (no file header information)
- uLaw - 8kS/s, 8-bit, single channel (mono) WAV files:
•   uLaw: 8kS/s, 8 bit, single channel (mono)
•   PCM: 8-44 kS/s, 8-16 bit, multi-channel
 
So judging by the last line I would have exepected the files to play correctly, but they don't. In the logs on the phone I get
 
2012-02-27 05:37:53:0510 CP-7925G user.debug java: Trying to play sound http://192.168.0.203/i8.wav
2012-02-27 05:37:53:0510 CP-7925G user.debug java: Manager.jpp():createPlayer(): 1 - param as String locator =http://192.168.0.203/i8.wav
2012-02-27 05:37:53:0860 CP-7925G user.debug java: BasicPlayer():setLoopCount(1)
2012-02-27 05:37:53:0870 CP-7925G user.debug java: BasicPlayer():prefetch
2012-02-27 05:37:53:0870 CP-7925G user.debug java: BasicPlayer():realize()
2012-02-27 05:37:53:0880 CP-7925G user.debug java: WavPlayer():Header Contents: encoding=1, channels=1
2012-02-27 05:37:53:0880 CP-7925G user.debug java: WavPlayer():sRate=8000, bytesPerSecond=16000, align=2, sampleSizeInBits=16
2012-02-27 05:37:53:0880 CP-7925G user.debug java: Duration=6850000
2012-02-27 05:37:53:0950 CP-7925G user.err java: Unknown format!!
2012-02-27 05:37:53:0950 CP-7925G user.notice java: BasicPlayer:nOpen(format=unknown, bits=16, sRate=8000 
2012-02-27 05:37:53:0970 CP-7925G user.crit java: Audio Path is set to 2[Ringer]
2012-02-27 05:37:53:0970 CP-7925G user.notice java: AUD Event = AUD_USE_SPEAKER: 0 0 0  
2012-02-27 05:37:53:0970 CP-7925G user.notice java: AUD Event = AUD_SET_SPEAKER_VOLUME: 1 0 0  
2012-02-27 05:37:53:0970 CP-7925G user.crit java: getVolume()=&gt;16: audio_path=1
2012-02-27 05:37:53:0970 CP-7925G user.notice java: AUD Event = AUD_SET_SPEAKER_VOLUME: 0 0 0  
2012-02-27 05:37:53:0970 CP-7925G user.notice java: setVolume(16):AUD_setVolume(audio_path=2 level=0)
2012-02-27 05:37:53:0970 CP-7925G user.notice java: AUD Event = AUD_SET_SPEAKER_VOLUME: 0 0 0  
2012-02-27 05:37:53:0970 CP-7925G user.notice java: setVolume(16):AUD_setVolume(audio_path=2 level=0)
2012-02-27 05:37:53:0980 CP-7925G user.debug java: BasicPlayer():realize()
2012-02-27 05:37:53:0980 CP-7925G user.debug java: BasicPlayer():start()
2012-02-27 05:37:53:0980 CP-7925G user.notice java: AUD_PlayStreamAudio CODEC type 176 
2012-02-27 05:37:53:0980 CP-7925G user.notice java: AUD Event = AUD_PlayStreamAudio 0 
2012-02-27 05:37:53:0980 CP-7925G user.notice java: AUD_PlayStreamAudio CODEC type 176 
2012-02-27 05:37:54:0220 CP-7925G user.notice java: AudEventRspQueue -  msgrcv qid : 0x48009, buf 0xbfff5814, size 4 rv 4 
2012-02-27 05:37:54:0220 CP-7925G user.notice java: AUD Event = AUD_PlayStreamAudio 7680 
2012-02-27 05:37:54:0220 CP-7925G user.notice java: AUD_PlayStreamAudio CODEC type 176 
 
Obviously there is the line saying Unknown format, but why?
 
Can somebody tell me what I'm doing wrong
 
Thanks in advance</summary>
    <dc:creator>Trevor Rowe</dc:creator>
    <dc:date>2012-03-28T17:41:05Z</dc:date>
  </entry>
</feed>

