BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 12-30-2010, 08:44 AM   #1
patrickLaza
New Member
 
Join Date: Aug 2010
Model: 9000
PIN: N/A
Carrier: E_PLUS
Posts: 1
Default Real Time Sound Synthesis on BB

Please Login to Remove!

Hi all,

i'm working on a user event based real time sound synth. app. that should work with raw audio, using a ring buffer that constantly feeds the data to the blackberry player and loops the sound until some user event happens. Since the player doesn't support raw audio i'm sending a WAV header (with modified media length so the player doesn't stop when the end of a sample is reached) when the player starts and before i'm sending the actual audio data. Currently i can play a custom generated sine tone but i'm facing a major problem when trying to change the sample (resample the sine at a new frequency and send it to the player) at real time. The idea was, since i can't modify the readpointer of the player, to flush the player buffer with StreamingBufferControl.flush(), to reset the player and when he requests the new data to send him the new samples, but that didn't work out at all. I've tried debugging the player to see what exactly is happening after a flush and the result was:

- After calling flush() a com.rim.flush Event is sent from the player
- The player plays the old sample for a couple of seconds
- Buffers are set to 0 and the player requests 4 times the new sample
- Now the player starts playing the new sample

Here's the debugging text:

Code:
******************
Player Event : com.rim.flush
******************
MP: h=16777216,s=PL: mStat: 3220
******************
Player Event : com.rim.timeUpdate
******************
MP: h=16777216,s=PL: mStat: 4200
******************
Player Event : com.rim.timeUpdate
******************
MP: h=16777216,s=PL: mStat: 5200
******************
Player Event : com.rim.timeUpdate
******************
MP: h=16777216,s=PL: mStat: 6220
******************
Player Event : com.rim.timeUpdate
******************
MN: flushBuffers0(16777216)=0
***************** Copying : 204797 bytes of data to player at index : 3
***************** 
***************** Copying : 204800 bytes of data to player at index : 0
***************** 
***************** Copying : 204797 bytes of data to player at index : 3
***************** 
***************** Copying :122880 bytes of data to player at index :  0
*****************
***************** Copying : 204796 bytes of data to player at index : 4
*****************
MP: h=16777216,s=PL: mStat: 7240
******************
Player Event : com.rim.timeUpdate
******************
MP: h=16777216,s=PL: mStat: 8260
******************
Player Event : com.rim.timeUpdate
*****************
***************** Copying : 165932 bytes of data to player at index : 0
Could someone please explain to me how the bb player works or give me some ideas to how i can work around this problem.

I still don't understand why the player is requesting 4 times the data. Is it possible that the player has multiple buffers to play the audio without any delays, so that when a flush occurs it plays the data from all buffers first before reseting them?

PS: multiple players didn't work out, the delay time starting the new player and buffering the data took to long.

Thanks in advance
Offline  
Closed Thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads for: Real Time Sound Synthesis on BB
Thread Thread Starter Forum Replies Last Post
BB Sound drivers jvelarde General 9700 Series Discussion - Bold 2 5 05-23-2010 09:45 PM
Last Contact Time: What is REAL??!!?? Getting very irritated with DEAD users. RJeffDay BES Admin Corner 5 02-01-2010 10:46 AM
Long time BB user heavily considering the Pre Skinflaps BlackBerry Versus 8 06-17-2009 07:08 AM
Bluetooth Headset Reviews barjohn Bluetooth Connection 500 12-06-2007 06:47 AM
Desktop Manager Can't Sync Device Time Correctly traveler20 RIM Software 0 04-14-2007 12:32 PM


Lot of 2 IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM picture

Lot of 2 IBM Correctable Ribbon Cassette Black 1299300 NOS Original OEM

$12.00



OEM IBM Selectric II Key Tops & Parts picture

OEM IBM Selectric II Key Tops & Parts

$49.95



New 2 Sets of 2 (4) keys total OEM 9952 IBM Keys for Cash Drawers Displays Locks picture

New 2 Sets of 2 (4) keys total OEM 9952 IBM Keys for Cash Drawers Displays Locks

$14.99



IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360 picture

IBM CASH DRAWER KEY'S #9960 SET OF 2 KEYS. AFTERMARKET KEY'S SAME AS OEM 33G3360

$18.00



OEM  IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working picture

OEM IBM Type 5441 WheelWriter 3 1356658 1362400-02 Main Boards Tested Working

$49.99



IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259 picture

IBM Genuine OEM Printer Filler Wide Credit Card Holder 10N1259

$24.79







Copyright © 2004-2016 BlackBerryForums.com.
The names RIM © and BlackBerry © are registered Trademarks of BlackBerry Inc.