Jarek P

Greenhorn
+ Follow
since Sep 04, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jarek P

Hello

I'm using series 60 sdk 2.1. Emulator shows me some confirm messages, which stop program and are waiting for confirmation.
For example when I use capture audio: "midlet ... need acces to camera or audio features. accept??"
Or when I write to file (via http) I have message: "midlet need http conecion" (or something like that).

How cun I turn off this messages??

Thanks for any help
19 years ago
Hello

I have some questions about audio capturing

I use this code to capture audio

Player p = Manager.createPlayer("capture://audio?rate=8000&bits=8&channels=1");
p.realize();
RecordControl rc = (RecordControl) p.getControl("RecordControl");
ByteArrayOutputStream output = new ByteArrayOutputStream();
rc.setRecordStream(output);
rc.startRecord();
p.start();
Thread.currentThread().sleep(1000);
rc.commit();
p.close();
buf = output.toByteArray();

I'm using series 60 midp sdk 2_1_beta and it's emulator.

1. Bits are set to 8 and buf if byte array. But how data will be saved when i change bits=16. I must use something different that ByteArrayOutputStream or then two array cells store one 16bit number (then correct values is something like that: array[i]+255*array[i+1])??
2. Record time is set to 1000 and rate 8000 so output array size should be 8000, but every time i save i have different array size (about 7000 to 9000). Why is that. It does mean that emulator didn't save exactly one second or saving rate isn't equal 8000??
3. How can i play sound, that i have saved (stored in buf)??

Thanks for any help
19 years ago