2 * Direct Sound Audio Renderer
4 * Copyright 2004 Christian Costa
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23 #include "quartz_private.h"
24 #include "control_private.h"
38 #include "wine/unicode.h"
39 #include "wine/debug.h"
41 WINE_DEFAULT_DEBUG_CHANNEL(quartz);
43 static const WCHAR wcsInputPinName[] = {'i','n','p','u','t',' ','p','i','n',0};
45 static const IBaseFilterVtbl DSoundRender_Vtbl;
46 static const IPinVtbl DSoundRender_InputPin_Vtbl;
47 static const IMemInputPinVtbl MemInputPin_Vtbl;
48 static const IBasicAudioVtbl IBasicAudio_Vtbl;
50 typedef struct DSoundRenderImpl
52 const IBaseFilterVtbl * lpVtbl;
53 const IBasicAudioVtbl *IBasicAudio_vtbl;
56 CRITICAL_SECTION csFilter;
58 REFERENCE_TIME rtStreamStart;
59 IReferenceClock * pClock;
60 FILTER_INFO filterInfo;
66 LPDIRECTSOUNDBUFFER dsbuffer;
72 static HRESULT DSoundRender_InputPin_Construct(const PIN_INFO * pPinInfo, SAMPLEPROC pSampleProc, LPVOID pUserData, QUERYACCEPTPROC pQueryAccept, LPCRITICAL_SECTION pCritSec, IPin ** ppPin)
78 if (pPinInfo->dir != PINDIR_INPUT)
80 ERR("Pin direction(%x) != PINDIR_INPUT\n", pPinInfo->dir);
84 pPinImpl = CoTaskMemAlloc(sizeof(*pPinImpl));
89 if (SUCCEEDED(InputPin_Init(pPinInfo, pSampleProc, pUserData, pQueryAccept, pCritSec, pPinImpl)))
91 pPinImpl->pin.lpVtbl = &DSoundRender_InputPin_Vtbl;
92 pPinImpl->lpVtblMemInput = &MemInputPin_Vtbl;
94 *ppPin = (IPin *)(&pPinImpl->pin.lpVtbl);
101 #define DSBUFFERSIZE 8192
103 static HRESULT DSoundRender_CreateSoundBuffer(IBaseFilter * iface)
106 WAVEFORMATEX wav_fmt;
108 WAVEFORMATEX* format;
109 DSBUFFERDESC buf_desc;
110 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
112 hr = IPin_ConnectionMediaType(This->ppPins[0], &amt);
114 ERR("Unable to retrieve media type\n");
118 TRACE("MajorType %s\n", debugstr_guid(&amt.majortype));
119 TRACE("SubType %s\n", debugstr_guid(&amt.subtype));
120 TRACE("Format %s\n", debugstr_guid(&amt.formattype));
121 TRACE("Size %d\n", amt.cbFormat);
123 dump_AM_MEDIA_TYPE(&amt);
125 format = (WAVEFORMATEX*)amt.pbFormat;
126 TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM);
127 TRACE("nChannels = %d\n", format->nChannels);
128 TRACE("nSamplesPerSec = %u\n", format->nSamplesPerSec);
129 TRACE("nAvgBytesPerSec = %u\n", format->nAvgBytesPerSec);
130 TRACE("nBlockAlign = %d\n", format->nBlockAlign);
131 TRACE("wBitsPerSample = %d\n", format->wBitsPerSample);
132 TRACE("cbSize = %d\n", format->cbSize);
134 hr = DirectSoundCreate(NULL, &This->dsound, NULL);
136 ERR("Cannot create Direct Sound object\n");
143 memset(&buf_desc,0,sizeof(DSBUFFERDESC));
144 buf_desc.dwSize = sizeof(DSBUFFERDESC);
145 buf_desc.dwBufferBytes = DSBUFFERSIZE;
146 buf_desc.lpwfxFormat = &wav_fmt;
147 hr = IDirectSound_CreateSoundBuffer(This->dsound, &buf_desc, &This->dsbuffer, NULL);
149 ERR("Can't create sound buffer !\n");
150 IDirectSound_Release(This->dsound);
159 static HRESULT DSoundRender_SendSampleData(DSoundRenderImpl* This, LPBYTE data, DWORD size)
162 LPBYTE lpbuf1 = NULL;
163 LPBYTE lpbuf2 = NULL;
167 DWORD play_pos,buf_free;
169 if (This->state != State_Running) {
171 if (SUCCEEDED(IDirectSoundBuffer_GetStatus(This->dsbuffer, &state))) {
172 if (state & DSBSTATUS_PLAYING) {
173 IDirectSoundBuffer_Stop(This->dsbuffer);
174 This->started = FALSE;
182 hr = IDirectSoundBuffer_GetCurrentPosition(This->dsbuffer, &play_pos, NULL);
185 ERR("Error GetCurrentPosition: %x\n", hr);
188 if (This->write_pos < play_pos)
189 buf_free = play_pos-This->write_pos;
191 buf_free = DSBUFFERSIZE - This->write_pos + play_pos;
193 /* This situation is ambiguous; Assume full when playing */
194 if(buf_free == DSBUFFERSIZE && This->started)
200 size2 = min(buf_free, size);
201 hr = IDirectSoundBuffer_Lock(This->dsbuffer, This->write_pos, size2, &lpbuf1, &dwsize1, &lpbuf2, &dwsize2, 0);
203 ERR("Unable to lock sound buffer! (%x)\n", hr);
206 /* TRACE("write_pos=%d, size=%d, sz1=%d, sz2=%d\n", This->write_pos, size2, dwsize1, dwsize2); */
208 memcpy(lpbuf1, data, dwsize1);
210 memcpy(lpbuf2, data + dwsize1, dwsize2);
212 hr = IDirectSoundBuffer_Unlock(This->dsbuffer, lpbuf1, dwsize1, lpbuf2, dwsize2);
214 ERR("Unable to unlock sound buffer! (%x)\n", hr);
217 hr = IDirectSoundBuffer_Play(This->dsbuffer, 0, 0, DSBPLAY_LOOPING);
219 This->started = TRUE;
221 ERR("Can't start playing! (%x)\n", hr);
223 size -= dwsize1 + dwsize2;
224 data += dwsize1 + dwsize2;
225 This->write_pos = (This->write_pos + dwsize1 + dwsize2) % DSBUFFERSIZE;
235 static HRESULT DSoundRender_Sample(LPVOID iface, IMediaSample * pSample)
237 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
238 LPBYTE pbSrcStream = NULL;
239 long cbSrcStream = 0;
240 REFERENCE_TIME tStart, tStop;
243 TRACE("%p %p\n", iface, pSample);
245 hr = IMediaSample_GetPointer(pSample, &pbSrcStream);
248 ERR("Cannot get pointer to sample data (%x)\n", hr);
252 hr = IMediaSample_GetTime(pSample, &tStart, &tStop);
254 ERR("Cannot get sample time (%x)\n", hr);
256 cbSrcStream = IMediaSample_GetActualDataLength(pSample);
258 TRACE("Sample data ptr = %p, size = %ld\n", pbSrcStream, cbSrcStream);
260 #if 0 /* For debugging purpose */
263 for(i = 0; i < cbSrcStream; i++)
265 if ((i!=0) && !(i%16))
267 TRACE("%02x ", pbSrcStream[i]);
275 hr = DSoundRender_CreateSoundBuffer(iface);
280 ERR("Unable to create DSound buffer\n");
285 hr = DSoundRender_SendSampleData(This, pbSrcStream, cbSrcStream);
290 static HRESULT DSoundRender_QueryAccept(LPVOID iface, const AM_MEDIA_TYPE * pmt)
292 WAVEFORMATEX* format = (WAVEFORMATEX*)pmt->pbFormat;
293 TRACE("wFormatTag = %x %x\n", format->wFormatTag, WAVE_FORMAT_PCM);
294 TRACE("nChannels = %d\n", format->nChannels);
295 TRACE("nSamplesPerSec = %d\n", format->nAvgBytesPerSec);
296 TRACE("nAvgBytesPerSec = %d\n", format->nAvgBytesPerSec);
297 TRACE("nBlockAlign = %d\n", format->nBlockAlign);
298 TRACE("wBitsPerSample = %d\n", format->wBitsPerSample);
300 if (IsEqualIID(&pmt->majortype, &MEDIATYPE_Audio) && IsEqualIID(&pmt->subtype, &MEDIASUBTYPE_PCM))
305 HRESULT DSoundRender_create(IUnknown * pUnkOuter, LPVOID * ppv)
309 DSoundRenderImpl * pDSoundRender;
311 TRACE("(%p, %p)\n", pUnkOuter, ppv);
316 return CLASS_E_NOAGGREGATION;
318 pDSoundRender = CoTaskMemAlloc(sizeof(DSoundRenderImpl));
320 pDSoundRender->lpVtbl = &DSoundRender_Vtbl;
321 pDSoundRender->IBasicAudio_vtbl = &IBasicAudio_Vtbl;
322 pDSoundRender->refCount = 1;
323 InitializeCriticalSection(&pDSoundRender->csFilter);
324 pDSoundRender->state = State_Stopped;
325 pDSoundRender->pClock = NULL;
326 pDSoundRender->init = FALSE;
327 pDSoundRender->started = FALSE;
328 ZeroMemory(&pDSoundRender->filterInfo, sizeof(FILTER_INFO));
330 pDSoundRender->ppPins = CoTaskMemAlloc(1 * sizeof(IPin *));
332 /* construct input pin */
333 piInput.dir = PINDIR_INPUT;
334 piInput.pFilter = (IBaseFilter *)pDSoundRender;
335 lstrcpynW(piInput.achName, wcsInputPinName, sizeof(piInput.achName) / sizeof(piInput.achName[0]));
336 hr = DSoundRender_InputPin_Construct(&piInput, DSoundRender_Sample, (LPVOID)pDSoundRender, DSoundRender_QueryAccept, &pDSoundRender->csFilter, (IPin **)&pDSoundRender->pInputPin);
340 pDSoundRender->ppPins[0] = (IPin *)pDSoundRender->pInputPin;
341 *ppv = (LPVOID)pDSoundRender;
345 CoTaskMemFree(pDSoundRender->ppPins);
346 DeleteCriticalSection(&pDSoundRender->csFilter);
347 CoTaskMemFree(pDSoundRender);
353 static HRESULT WINAPI DSoundRender_QueryInterface(IBaseFilter * iface, REFIID riid, LPVOID * ppv)
355 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
356 TRACE("(%p, %p)->(%s, %p)\n", This, iface, qzdebugstr_guid(riid), ppv);
360 if (IsEqualIID(riid, &IID_IUnknown))
362 else if (IsEqualIID(riid, &IID_IPersist))
364 else if (IsEqualIID(riid, &IID_IMediaFilter))
366 else if (IsEqualIID(riid, &IID_IBaseFilter))
368 else if (IsEqualIID(riid, &IID_IBasicAudio))
369 *ppv = (LPVOID)&(This->IBasicAudio_vtbl);
373 IUnknown_AddRef((IUnknown *)(*ppv));
377 FIXME("No interface for %s!\n", qzdebugstr_guid(riid));
379 return E_NOINTERFACE;
382 static ULONG WINAPI DSoundRender_AddRef(IBaseFilter * iface)
384 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
385 ULONG refCount = InterlockedIncrement(&This->refCount);
387 TRACE("(%p/%p)->() AddRef from %d\n", This, iface, refCount - 1);
392 static ULONG WINAPI DSoundRender_Release(IBaseFilter * iface)
394 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
395 ULONG refCount = InterlockedDecrement(&This->refCount);
397 TRACE("(%p/%p)->() Release from %d\n", This, iface, refCount + 1);
401 DeleteCriticalSection(&This->csFilter);
403 IReferenceClock_Release(This->pClock);
406 IDirectSoundBuffer_Release(This->dsbuffer);
407 This->dsbuffer = NULL;
409 IDirectSound_Release(This->dsound);
412 IPin_Release(This->ppPins[0]);
414 HeapFree(GetProcessHeap(), 0, This->ppPins);
416 This->IBasicAudio_vtbl = NULL;
418 TRACE("Destroying Audio Renderer\n");
427 /** IPersist methods **/
429 static HRESULT WINAPI DSoundRender_GetClassID(IBaseFilter * iface, CLSID * pClsid)
431 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
432 TRACE("(%p/%p)->(%p)\n", This, iface, pClsid);
434 *pClsid = CLSID_DSoundRender;
439 /** IMediaFilter methods **/
441 static HRESULT WINAPI DSoundRender_Stop(IBaseFilter * iface)
444 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
446 TRACE("(%p/%p)->()\n", This, iface);
448 EnterCriticalSection(&This->csFilter);
450 This->state = State_Stopped;
452 LeaveCriticalSection(&This->csFilter);
457 static HRESULT WINAPI DSoundRender_Pause(IBaseFilter * iface)
460 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
462 TRACE("(%p/%p)->()\n", This, iface);
464 EnterCriticalSection(&This->csFilter);
466 This->state = State_Paused;
468 LeaveCriticalSection(&This->csFilter);
473 static HRESULT WINAPI DSoundRender_Run(IBaseFilter * iface, REFERENCE_TIME tStart)
476 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
478 TRACE("(%p/%p)->(%s)\n", This, iface, wine_dbgstr_longlong(tStart));
480 EnterCriticalSection(&This->csFilter);
482 This->rtStreamStart = tStart;
483 This->state = State_Running;
485 LeaveCriticalSection(&This->csFilter);
490 static HRESULT WINAPI DSoundRender_GetState(IBaseFilter * iface, DWORD dwMilliSecsTimeout, FILTER_STATE *pState)
492 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
494 TRACE("(%p/%p)->(%d, %p)\n", This, iface, dwMilliSecsTimeout, pState);
496 EnterCriticalSection(&This->csFilter);
498 *pState = This->state;
500 LeaveCriticalSection(&This->csFilter);
505 static HRESULT WINAPI DSoundRender_SetSyncSource(IBaseFilter * iface, IReferenceClock *pClock)
507 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
509 TRACE("(%p/%p)->(%p)\n", This, iface, pClock);
511 EnterCriticalSection(&This->csFilter);
514 IReferenceClock_Release(This->pClock);
515 This->pClock = pClock;
517 IReferenceClock_AddRef(This->pClock);
519 LeaveCriticalSection(&This->csFilter);
524 static HRESULT WINAPI DSoundRender_GetSyncSource(IBaseFilter * iface, IReferenceClock **ppClock)
526 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
528 TRACE("(%p/%p)->(%p)\n", This, iface, ppClock);
530 EnterCriticalSection(&This->csFilter);
532 *ppClock = This->pClock;
533 IReferenceClock_AddRef(This->pClock);
535 LeaveCriticalSection(&This->csFilter);
540 /** IBaseFilter implementation **/
542 static HRESULT WINAPI DSoundRender_EnumPins(IBaseFilter * iface, IEnumPins **ppEnum)
545 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
547 TRACE("(%p/%p)->(%p)\n", This, iface, ppEnum);
549 epd.cPins = 1; /* input pin */
550 epd.ppPins = This->ppPins;
551 return IEnumPinsImpl_Construct(&epd, ppEnum);
554 static HRESULT WINAPI DSoundRender_FindPin(IBaseFilter * iface, LPCWSTR Id, IPin **ppPin)
556 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
558 TRACE("(%p/%p)->(%s,%p)\n", This, iface, debugstr_w(Id), ppPin);
560 FIXME("DSoundRender::FindPin(...)\n");
562 /* FIXME: critical section */
567 static HRESULT WINAPI DSoundRender_QueryFilterInfo(IBaseFilter * iface, FILTER_INFO *pInfo)
569 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
571 TRACE("(%p/%p)->(%p)\n", This, iface, pInfo);
573 strcpyW(pInfo->achName, This->filterInfo.achName);
574 pInfo->pGraph = This->filterInfo.pGraph;
577 IFilterGraph_AddRef(pInfo->pGraph);
582 static HRESULT WINAPI DSoundRender_JoinFilterGraph(IBaseFilter * iface, IFilterGraph *pGraph, LPCWSTR pName)
584 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
586 TRACE("(%p/%p)->(%p, %s)\n", This, iface, pGraph, debugstr_w(pName));
588 EnterCriticalSection(&This->csFilter);
591 strcpyW(This->filterInfo.achName, pName);
593 *This->filterInfo.achName = '\0';
594 This->filterInfo.pGraph = pGraph; /* NOTE: do NOT increase ref. count */
596 LeaveCriticalSection(&This->csFilter);
601 static HRESULT WINAPI DSoundRender_QueryVendorInfo(IBaseFilter * iface, LPWSTR *pVendorInfo)
603 DSoundRenderImpl *This = (DSoundRenderImpl *)iface;
604 TRACE("(%p/%p)->(%p)\n", This, iface, pVendorInfo);
608 static const IBaseFilterVtbl DSoundRender_Vtbl =
610 DSoundRender_QueryInterface,
612 DSoundRender_Release,
613 DSoundRender_GetClassID,
617 DSoundRender_GetState,
618 DSoundRender_SetSyncSource,
619 DSoundRender_GetSyncSource,
620 DSoundRender_EnumPins,
621 DSoundRender_FindPin,
622 DSoundRender_QueryFilterInfo,
623 DSoundRender_JoinFilterGraph,
624 DSoundRender_QueryVendorInfo
627 static HRESULT WINAPI DSoundRender_InputPin_EndOfStream(IPin * iface)
629 InputPin* This = (InputPin*)iface;
630 IMediaEventSink* pEventSink;
633 TRACE("(%p/%p)->()\n", This, iface);
635 hr = IFilterGraph_QueryInterface(((DSoundRenderImpl*)This->pin.pinInfo.pFilter)->filterInfo.pGraph, &IID_IMediaEventSink, (LPVOID*)&pEventSink);
638 /* FIXME: We should wait that all audio data has been played */
639 hr = IMediaEventSink_Notify(pEventSink, EC_COMPLETE, S_OK, 0);
640 IMediaEventSink_Release(pEventSink);
646 static const IPinVtbl DSoundRender_InputPin_Vtbl =
648 InputPin_QueryInterface,
652 InputPin_ReceiveConnection,
654 IPinImpl_ConnectedTo,
655 IPinImpl_ConnectionMediaType,
656 IPinImpl_QueryPinInfo,
657 IPinImpl_QueryDirection,
659 IPinImpl_QueryAccept,
660 IPinImpl_EnumMediaTypes,
661 IPinImpl_QueryInternalConnections,
662 DSoundRender_InputPin_EndOfStream,
668 static const IMemInputPinVtbl MemInputPin_Vtbl =
670 MemInputPin_QueryInterface,
673 MemInputPin_GetAllocator,
674 MemInputPin_NotifyAllocator,
675 MemInputPin_GetAllocatorRequirements,
677 MemInputPin_ReceiveMultiple,
678 MemInputPin_ReceiveCanBlock
681 /*** IUnknown methods ***/
682 static HRESULT WINAPI Basicaudio_QueryInterface(IBasicAudio *iface,
685 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
687 TRACE("(%p/%p)->(%s (%p), %p)\n", This, iface, debugstr_guid(riid), riid, ppvObj);
689 return DSoundRender_QueryInterface((IBaseFilter*)This, riid, ppvObj);
692 static ULONG WINAPI Basicaudio_AddRef(IBasicAudio *iface) {
693 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
695 TRACE("(%p/%p)->()\n", This, iface);
697 return DSoundRender_AddRef((IBaseFilter*)This);
700 static ULONG WINAPI Basicaudio_Release(IBasicAudio *iface) {
701 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
703 TRACE("(%p/%p)->()\n", This, iface);
705 return DSoundRender_Release((IBaseFilter*)This);
708 /*** IDispatch methods ***/
709 static HRESULT WINAPI Basicaudio_GetTypeInfoCount(IBasicAudio *iface,
711 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
713 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, pctinfo);
718 static HRESULT WINAPI Basicaudio_GetTypeInfo(IBasicAudio *iface,
721 ITypeInfo**ppTInfo) {
722 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
724 TRACE("(%p/%p)->(%d, %d, %p): stub !!!\n", This, iface, iTInfo, lcid, ppTInfo);
729 static HRESULT WINAPI Basicaudio_GetIDsOfNames(IBasicAudio *iface,
735 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
737 TRACE("(%p/%p)->(%s (%p), %p, %d, %d, %p): stub !!!\n", This, iface, debugstr_guid(riid), riid, rgszNames, cNames, lcid, rgDispId);
742 static HRESULT WINAPI Basicaudio_Invoke(IBasicAudio *iface,
747 DISPPARAMS*pDispParams,
751 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
753 TRACE("(%p/%p)->(%d, %s (%p), %d, %04x, %p, %p, %p, %p): stub !!!\n", This, iface, dispIdMember, debugstr_guid(riid), riid, lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
758 /*** IBasicAudio methods ***/
759 static HRESULT WINAPI Basicaudio_put_Volume(IBasicAudio *iface,
761 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
763 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lVolume);
768 static HRESULT WINAPI Basicaudio_get_Volume(IBasicAudio *iface,
770 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
772 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plVolume);
777 static HRESULT WINAPI Basicaudio_put_Balance(IBasicAudio *iface,
779 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
781 TRACE("(%p/%p)->(%ld): stub !!!\n", This, iface, lBalance);
786 static HRESULT WINAPI Basicaudio_get_Balance(IBasicAudio *iface,
788 ICOM_THIS_MULTI(DSoundRenderImpl, IBasicAudio_vtbl, iface);
790 TRACE("(%p/%p)->(%p): stub !!!\n", This, iface, plBalance);
795 static const IBasicAudioVtbl IBasicAudio_Vtbl =
797 Basicaudio_QueryInterface,
800 Basicaudio_GetTypeInfoCount,
801 Basicaudio_GetTypeInfo,
802 Basicaudio_GetIDsOfNames,
804 Basicaudio_put_Volume,
805 Basicaudio_get_Volume,
806 Basicaudio_put_Balance,
807 Basicaudio_get_Balance