[Live-devel] Capturing audio from microphone

Lancerica Laurent-llan1c llan1c at motorola.com
Tue Oct 12 11:05:35 PDT 2004


Thanks a lot for answer.

I try to use your advice, swaping byte for the network, using quicktime player the sound is still noise and not my voice, do you have an idea using  the following line ?

Thanks
Best Regards

laurent lancerica

struct sessionState_S {
	  FramedSource* audioSource;
	  RTPSink* audioSink;
   } sessionStateS;

int inputPortNumber = 0;
			unsigned char bitsPerSample = 16;
			unsigned char numChannels = 1;
			unsigned samplingFrequency = 8000;
			unsigned granularityInMS=20;
			//WindowsAudioInputDevice* pcmSource;
			AudioInputDevice* pcmSource;
			pcmSource = AudioInputDevice::createNew(*env,inputPortNumber,bitsPerSample,numChannels, samplingFrequency, granularityInMS);
			sessionStateS.audioSource = EndianSwap16::createNew(*env, pcmSource);
			sessionStateS.audioSink->startPlaying(*sessionStateS.audioSource, RTPSender::afterPlaying, NULL);

where  :
			sessionStateS.audioSink = SimpleRTPSink::createNew(*env, &rtpGroupsock, RTPpayloadType_obj, rtpTimestampFrequency_obj, rtpPayloadFormatName_obj, rtpPayloadFormatName_obj, 1, false, true);

-----Original Message-----
From: live-devel-bounces at ns.live.com
[mailto:live-devel-bounces at ns.live.com]On Behalf Of Ross Finlayson
Sent: Monday, October 11, 2004 10:22 PM
To: LIVE.COM Streaming Media - development & use
Subject: RE: [Live-devel] Capturing audio from microphone



>Now I can see that packets are send on the network, nevertheless I try to 
>ear this streamed voice using quicktime player but I don't ear voice only 
>"schratch noise"
>what's the problem ??

I don't know, but you haven't told us what "RTPSink" you're using to stream 
the audio.  If you're not doing any encoding (i.e., compression) on the PCM 
audio that you're getting from the "AudioInputDevice", then you will need 
to use a "SimpleRTPSink", specifying the "audio/L16" MIME type.  *And* 
(important!) because the audio samples will be in little-endian order, you 
will need to byte-swap them (into big-endian, i.e., 'network' byte order) 
before feeding them into the "SimpleRTPSink".

See the source code for the "testWAVAudioStreamer" demo program for an 
illustration of how to do this.


	Ross Finlayson
	LIVE.COM
	<http://www.live.com/>

_______________________________________________
live-devel mailing list
live-devel at lists.live.com
http://lists.live.com/mailman/listinfo/live-devel


More information about the live-devel mailing list