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


1pcs New CKD Solenoid Valve 4KB240-08-L-AC110V picture

1pcs New CKD Solenoid Valve 4KB240-08-L-AC110V

$167.00



Numatics Manifold Base w/ (3) Solenoid Valves 061BB415M000061 / 061BA415M000061 picture

Numatics Manifold Base w/ (3) Solenoid Valves 061BB415M000061 / 061BA415M000061

$75.00



Festo Manifold Block Assembly w/ (9) Solenoid Valves 568656, 556838, 533343 picture

Festo Manifold Block Assembly w/ (9) Solenoid Valves 568656, 556838, 533343

$300.00



varian solenoid koganei a110-4e2-83-psl-3l new no box stock K-1855 picture

varian solenoid koganei a110-4e2-83-psl-3l new no box stock K-1855

$66.50



Cole Hersee (24059-BP) 12V Insulated SPST Continuous Duty Solenoid picture

Cole Hersee (24059-BP) 12V Insulated SPST Continuous Duty Solenoid

$32.82



SA-3786-12 603350 Fuel Shutoff Solenoid Kubota Compatible 721D2 21HP Grasshopper picture

SA-3786-12 603350 Fuel Shutoff Solenoid Kubota Compatible 721D2 21HP Grasshopper

$30.29







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