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


TOA ZM-104A Impedance Meter Measures Impedance of Speaker Line picture

TOA ZM-104A Impedance Meter Measures Impedance of Speaker Line

$79.99



BECO Universal Impedance Capicitancel 315A, Brown Electro Measurement Corp. 315A picture

BECO Universal Impedance Capicitancel 315A, Brown Electro Measurement Corp. 315A

$139.00



Tenma 72-6960 Audio Impedance Tester picture

Tenma 72-6960 Audio Impedance Tester

$75.00



Canare BCJ-XP-TRB Impedance Transformer picture

Canare BCJ-XP-TRB Impedance Transformer

$7.99



HP-Agilent-Keysight 41951-69001/ 41951-61001 Impedance Test Adapter for 41951A picture

HP-Agilent-Keysight 41951-69001/ 41951-61001 Impedance Test Adapter for 41951A

$350.00



New Tonghui TH2810D LCR Meter Digital Eectrical bridge impedance measurement picture

New Tonghui TH2810D LCR Meter Digital Eectrical bridge impedance measurement

$499.00







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