OpenNETCF Sound Recorder on Smartphone 2003

  • Thread starter Razvan Dragomirescu
  • Start date
R

Razvan Dragomirescu

Hello everyone,

I was just wondering if the OpenNETCF Sound Recorder
(OpenNETCF.Multimedia.Audio.Recorder) works on a Smartphone 2003 device. I
keep getting an IOException when trying to record. Here's my code:

------------------------------------------
public void recordSound()

{

Recorder r = new Recorder();

FileStream fs = File.OpenWrite(@"test.wav");

r.RecordFor(fs, 10, SoundFormats.Mono16bit44kHz);


}

---------------------------------------------------------------

Also, what is the expected behaviour of this class? Does it write sound
samples to the output stream as it collects them? Or does it wait for the
recording interval to complete, then it outputs it all to the stream? My
intention is to monitor the input in real time, is this doable?

Thanks,

Razvan

--

Razvan Dragomirescu

Chief Technology Officer

SIMEDA GmbH

www.simeda.com
 
J

Jon Skeet [C# MVP]

Razvan Dragomirescu said:
I was just wondering if the OpenNETCF Sound Recorder
(OpenNETCF.Multimedia.Audio.Recorder) works on a Smartphone 2003 device. I
keep getting an IOException when trying to record. Here's my code:

Does the IOException have a message, by any chance? Have you tried
specifying an absolute filename?
 
A

Alex Feinman [MVP]

1) IOException would typically have a reason associated with it.
2) You may want to specify a file path when creating the stream
3) SoundRecorder class writes to the buffer regularly, in chunks, as soon as
wave data arrives.
 
R

Razvan Dragomirescu

Sorry guys, false alarm, I guess I just posted too soon :S. It was a
permissions thing, I was trying to write it to the root directory and
apparently that's the ROM or something. Writing it with an absolute path
(\Storage\Program Files\test.wav) worked like a charm.

Sorry once again, I feel sort of silly :(.

Thanks,
Razvan

--
Razvan Dragomirescu
Chief Technology Officer
SIMEDA GmbH
www.simeda.com
 
Top