Guest
Apr 17, 2008 2:33 PM
[OpenSIPStack] How can I add a mediaformat to a soundchannel ?
Hi,
I was working with sound channels and had a problem: How can I add a media
format to it ?
And How can I recognise the sound devices that are present in the computer ?
I have tried the following solutions. But it did not work. Any guess ?
Thanks in advance.
Claudio Miceli de Farias
PSoundChannel * MMedia::CreateSoundChannel(const OpalMediaFormat &
mediaFormat,
BOOL isSource)
{
PString deviceName;
PSoundChannel * soundChannel = new PSoundChannel();
if (isSource)
deviceName = soundChannel->GetDefaultDevice(
PSoundChannel::Recorder );
else
deviceName = soundChannel->GetDefaultDevice(
PSoundChannel::Player );
if (isSource) cout << "\n record device: " << deviceName << "\n";
if (soundChannel->Open(deviceName,
isSource ? PSoundChannel::Recorder
: PSoundChannel::Player,
1, mediaFormat.GetClockRate(), 16)) {
PTRACE(1, "PCSS\tOpened sound channel \"" << deviceName
<< "\" for " << (isSource ? "record" : "play") <<
"ing."); //nao estah entrando aqui
return soundChannel;
}
return soundChannel;
}
OpalMediaStream * MMedia::CreateMediaStream(const OpalMediaFormat &
mediaFormat,
unsigned
sessionID,BOOL isSource)
{
PSoundChannel * soundChannel = CreateSoundChannel(mediaFormat,
isSource);
if (soundChannel == NULL)
return NULL;
return new OpalAudioMediaStream(mediaFormat, sessionID, isSource,
soundChannelBuffers, soundChannel);
}
OpalAudioFormat::OpalAudioFormat (OPAL_G711_ULAW_64K,
RTP_DataFrame::PCMU, "PCMU", 8, 8, 240, 30, 256);
mediaFormats+= OpalMediaFormat::OpalMediaFormat(OPAL_G711_ULAW_64K);
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
opensipstack-devel mailing list
opensipstack-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensipstack-devel
I was working with sound channels and had a problem: How can I add a media
format to it ?
And How can I recognise the sound devices that are present in the computer ?
I have tried the following solutions. But it did not work. Any guess ?
Thanks in advance.
Claudio Miceli de Farias
PSoundChannel * MMedia::CreateSoundChannel(const OpalMediaFormat &
mediaFormat,
BOOL isSource)
{
PString deviceName;
PSoundChannel * soundChannel = new PSoundChannel();
if (isSource)
deviceName = soundChannel->GetDefaultDevice(
PSoundChannel::Recorder );
else
deviceName = soundChannel->GetDefaultDevice(
PSoundChannel::Player );
if (isSource) cout << "\n record device: " << deviceName << "\n";
if (soundChannel->Open(deviceName,
isSource ? PSoundChannel::Recorder
: PSoundChannel::Player,
1, mediaFormat.GetClockRate(), 16)) {
PTRACE(1, "PCSS\tOpened sound channel \"" << deviceName
<< "\" for " << (isSource ? "record" : "play") <<
"ing."); //nao estah entrando aqui
return soundChannel;
}
return soundChannel;
}
OpalMediaStream * MMedia::CreateMediaStream(const OpalMediaFormat &
mediaFormat,
unsigned
sessionID,BOOL isSource)
{
PSoundChannel * soundChannel = CreateSoundChannel(mediaFormat,
isSource);
if (soundChannel == NULL)
return NULL;
return new OpalAudioMediaStream(mediaFormat, sessionID, isSource,
soundChannelBuffers, soundChannel);
}
OpalAudioFormat::OpalAudioFormat (OPAL_G711_ULAW_64K,
RTP_DataFrame::PCMU, "PCMU", 8, 8, 240, 30, 256);
mediaFormats+= OpalMediaFormat::OpalMediaFormat(OPAL_G711_ULAW_64K);
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
opensipstack-devel mailing list
opensipstack-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensipstack-devel









