--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/606ccd8a-8331-49db-8927-3624ccd444a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/b882623d-c03f-4f4b-a651-bb77b22d8aac%40googlegroups.com.
rtc::scoped_refptr<webrtc::AudioTrackInterface> pAudioTrack = nullptr;
// Set up constraints
webrtc::FakeConstraints audioSourceConstraints;
webrtc::PeerConnectionFactoryInterface::Options fakeOptions;
audioSourceConstraints.AddMandatory(webrtc::MediaConstraintsInterface::kGoogEchoCancellation, false);
audioSourceConstraints.AddOptional(webrtc::MediaConstraintsInterface::kExtendedFilterEchoCancellation, true);
audioSourceConstraints.AddOptional(webrtc::MediaConstraintsInterface::kDAEchoCancellation, true);
audioSourceConstraints.AddOptional(webrtc::MediaConstraintsInterface::kAutoGainControl, true);
audioSourceConstraints.AddOptional(webrtc::MediaConstraintsInterface::kExperimentalAutoGainControl, true);
audioSourceConstraints.AddMandatory(webrtc::MediaConstraintsInterface::kNoiseSuppression, false);
audioSourceConstraints.AddOptional(webrtc::MediaConstraintsInterface::kHighpassFilter, true);
m_pWebRTCLocalAudioSource = WebRTCLocalAudioSource::Create(fakeOptions, &audioSourceConstraints);
CN(m_pWebRTCLocalAudioSource);
pAudioTrack = rtc::scoped_refptr<webrtc::AudioTrackInterface>(
m_pWebRTCPeerConnectionFactory->CreateAudioTrack(
strAudioTrackLabel,
m_pWebRTCLocalAudioSource)
);
pAudioTrack->AddRef();
pMediaStreamInterface->AddTrack(pAudioTrack);
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/a8540089-da95-411a-ba80-a393dc53fbf8%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/03affafa-f3be-4745-a9df-b170cea4f5f8%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/f8a4b605-f354-4691-a0a2-1b3a2edde961%40googlegroups.com.
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/9c404aa0-f07c-45e3-8866-1cb98edd695d%40googlegroups.com.
TL;DR; Implement an AudioSourceInteface (inherit it from webrtc::LocalAudioSource or it will complain later on) and pass it as parameter when creating the AudioTrack, you will get the audio track sink in AudioCapturer::AddSink(webrtc::AudioTrackSinkInterface * sink) and you can later call sink->OnData to fetch data to the VOE channel.
And moreover, do I need to provide an external (dummy or not) ADM ?
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4dfb611d-c3c1-4de2-96ac-cca4e9a73fc0%40googlegroups.com.
If you don't do so, the internal adm will be feeding audio data simultaneously than your localaudiosoruce and they will be mixed together.
On 24/11/2017 11:12, benjami...@gmail.com wrote:
And moreover, do I need to provide an external (dummy or not) ADM ?--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4dfb611d-c3c1-4de2-96ac-cca4e9a73fc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/f3lIyA3Otyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/d1301887-d678-9eee-a518-f8583d00d06e%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAMRMz-539AfxUYA-Cw-kEG8WTgeQbdtB02VWT4WhLyCVgxAHoQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAMRMz-539AfxUYA-Cw-kEG8WTgeQbdtB02VWT4WhLyCVgxAHoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/f3lIyA3Otyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/7c2f0ffb-57e6-abfe-45c2-79847d714f48%40gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/4dfb611d-c3c1-4de2-96ac-cca4e9a73fc0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/f3lIyA3Otyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/d1301887-d678-9eee-a518-f8583d00d06e%40gmail.com.
--
---
You received this message because you are subscribed to the Google Groups "discuss-webrtc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAMRMz-539AfxUYA-Cw-kEG8WTgeQbdtB02VWT4WhLyCVgxAHoQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/f3lIyA3Otyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
FYI - I just learned that in order to get the track audio you still need to call NeedMorePlayData on the AudioTransport of the ADM (every 10ms) in order to get the OnData callback to occur.Scott
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/f3lIyA3Otyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/16be78ff-21e9-4775-a289-3b241404051f%40googlegroups.com.
I tried that a bit - and wasn't having too much luck. I looked at your code, however, and it looks like you're on a significantly different version of WebRTC than us and we really need to upgrade. In the meantime I've managed to sort of hack the RecordedDataAvailable function and to mix in a pending buffer into the audio received from the mic. It's a bit of a crude approach, but it's working well enough expect we're having an issue that the audio input is coming in faster than can be processed for some reason. Once this basic feature is up - I'm going to go back and update WebRTC and try the dummy ADM / sink approach since I think it's much more robust. Thanks for your help! |
To unsubscribe from this group and all its topics, send an email to discuss-webrt...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/CAKuk9BzXfCxMdPs3cqAumi4mKZHuk2V_enUBsff-RpyTA%2BOLVw%40mail.gmail.com.
--
---
You received this message because you are subscribed to a topic in the Google Groups "discuss-webrtc" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss-webrtc/f3lIyA3Otyo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss-webrtc+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/discuss-webrtc/c1853bc0-22b2-4570-8f51-d28394e97070%40googlegroups.com.
auto pWebRTCLocalAudioSource = WebRTCLocalAudioSource::Create(strAudioTrackLabel, fakeAudioOptions); CN(pWebRTCLocalAudioSource);
pWebRTCLocalAudioSource->SetAudioSourceName(strAudioTrackLabel);
// Add to map m_pWebRTCLocalAudioSources[strAudioTrackLabel] = pWebRTCLocalAudioSource;
///*
pAudioTrack = rtc::scoped_refptr<webrtc::AudioTrackInterface>( m_pWebRTCPeerConnectionFactory->CreateAudioTrack( strAudioTrackLabel,
pWebRTCLocalAudioSource) );
RESULT WebRTCLocalAudioTrack::SendAudioPacket(const AudioPacket &pendingAudioPacket) { RESULT r = R_PASS;
CN(m_pLocalAudioTrackSink);
//m_pLocalAudioSourceSink->OnData( // pendingAudioPacket.GetDataBuffer(), // pendingAudioPacket.GetBitsPerSample(), // pendingAudioPacket.GetSamplingRate(), // pendingAudioPacket.GetNumChannels(), // pendingAudioPacket.GetNumFrames() //);
int samples_per_sec = 44100; int nSamples = pendingAudioPacket.GetNumFrames(); int channels = 1;
static int count = 0; static int16_t *pDataBuffer = nullptr;
if (pDataBuffer == nullptr) { pDataBuffer = new int16_t[nSamples];
for (int i = 0; i < nSamples; i++) { pDataBuffer[i] = sin((count * 4200.0f) / samples_per_sec) * 10000; count++; } }
m_pLocalAudioTrackSink->OnData( pDataBuffer, 16, samples_per_sec, channels, nSamples );
Error: return r;}
m_audioProcessingThread = std::thread(&WebRTCConductor::ADMProcess, this);
...
RESULT WebRTCConductor::ADMProcess() { RESULT r = R_PASS; bool fDone = false;
size_t nSamples = 441; size_t nBytesPerSample = 4; size_t nChannels = 2; uint32_t samples_per_sec = 44100;
size_t nSamplesOut = 0; int64_t elapsed_time_ms = 0; int64_t ntp_time_ms = 0;
void* pAudioBufferData = (void*)malloc(nSamples * nBytesPerSample * nChannels); CN(pAudioBufferData);
while (fDone == false) {
CN(m_pAudioDeviceModule);
ntp_time_ms = -1; elapsed_time_ms = -1; nSamplesOut = 0;
int retval = reinterpret_cast<WebRTCAudioDeviceModule*>(m_pAudioDeviceModule.get())->GetTransport()->NeedMorePlayData( nSamples, nBytesPerSample, nChannels, samples_per_sec, pAudioBufferData, nSamplesOut, &elapsed_time_ms, &ntp_time_ms );
int16_t *pDataBuffer = (int16_t*)pAudioBufferData;
// Sleep a bit std::this_thread::sleep_for(std::chrono::milliseconds(10)); }
Error: return r;}