<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Fooling Around &#187; Audio</title>
	<atom:link href="http://alax.info/blog/category/audio/feed" rel="self" type="application/rss+xml" />
	<link>http://alax.info/blog</link>
	<description>// Software Production Line</description>
	<lastBuildDate>Wed, 02 May 2012 15:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Sample: Simultaneous Audio Playback via Waveform Audio (waveOut) API</title>
		<link>http://alax.info/blog/1291</link>
		<comments>http://alax.info/blog/1291#comments</comments>
		<pubDate>Wed, 12 Oct 2011 17:15:50 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[playback]]></category>
		<category><![CDATA[waveOut]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1291</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1291" title="Sample: Simultaneous Audio Playback via Waveform Audio (waveOut) API"></a>The minimalistic sample demonstrates support of [deprecated] Waveform Audio API for multiple playback streams. Depending on command line parameters, the application starts threads to open audio hardware using separate waveOutOpen call and stream one or more generated sine waves: 1,000 &#8230;<p class="read-more"><a href="http://alax.info/blog/1291">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1291" title="Sample: Simultaneous Audio Playback via Waveform Audio (waveOut) API"></a><p>The minimalistic sample demonstrates support of [deprecated] <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd757715%28v=VS.85%29.aspx">Waveform Audio API</a> for multiple playback streams.</p>
<p>Depending on command line parameters, the application starts threads to open audio hardware using separate <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/dd743866%28v=VS.85%29.aspx">waveOutOpen</a> call and stream one or more generated sine waves:</p>
<ul>
<li>1,000 Hz sine wave as 22,050 Hz, Mono, 16-bit PCM (command line parameter &#8220;a&#8221;)</li>
<li>5,000 Hz sine wave as 32,000 Hz, Mono, 16-bit PCM (command line parameter &#8220;b&#8221;)</li>
<li>15,000 Hz sine wave as 44,100 Hz, Mono, 16-bit PCM (command line parameter &#8220;c&#8221;)</li>
</ul>
<pre style="color: #000000; background: #ffffff;">Check<span style="color: #808030;">(</span><span style="color: #400000;">waveOutOpen</span><span style="color: #808030;">(</span><span style="color: #808030;">&amp;</span>hWaveOut<span style="color: #808030;">,</span> WAVE_MAPPER<span style="color: #808030;">,</span> <span style="color: #808030;">&amp;</span>WaveFormatEx<span style="color: #808030;">,</span> <span style="color: #7d0045;">NULL</span><span style="color: #808030;">,</span> <span style="color: #7d0045;">NULL</span><span style="color: #808030;">,</span> CALLBACK_NULL<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
ATLASSERT<span style="color: #808030;">(</span>hWaveOut<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
WAVEHDR<span style="color: #808030;">*</span> pWaveHeader<span style="color: #800080;">;</span>
<span style="color: #603000;">HGLOBAL</span> hWaveHeader <span style="color: #808030;">=</span> <span style="color: #808030;">(</span>WAVEHDR<span style="color: #808030;">*</span><span style="color: #808030;">)</span> <span style="color: #400000;">GlobalAlloc</span><span style="color: #808030;">(</span>GMEM_MOVEABLE <span style="color: #808030;">|</span> GMEM_SHARE<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pWaveHeader <span style="color: #808030;">+</span> WaveFormatEx<span style="color: #808030;">.</span>nAvgBytesPerSec <span style="color: #808030;">*</span> <span style="color: #008c00;">10</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
pWaveHeader <span style="color: #808030;">=</span> <span style="color: #808030;">(</span>WAVEHDR<span style="color: #808030;">*</span><span style="color: #808030;">)</span> <span style="color: #400000;">GlobalLock</span><span style="color: #808030;">(</span>hWaveHeader<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
ATLENSURE_THROW<span style="color: #808030;">(</span>pWaveHeader<span style="color: #808030;">,</span> E_OUTOFMEMORY<span style="color: #808030;">)</span><span style="color: #800080;">;</span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>lpData <span style="color: #808030;">=</span> <span style="color: #808030;">(</span><span style="color: #603000;">LPSTR</span><span style="color: #808030;">)</span> <span style="color: #808030;">(</span><span style="color: #603000;">BYTE</span><span style="color: #808030;">*</span><span style="color: #808030;">)</span> <span style="color: #808030;">(</span>pWaveHeader <span style="color: #808030;">+</span> <span style="color: #008c00;">1</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwBufferLength <span style="color: #808030;">=</span> WaveFormatEx<span style="color: #808030;">.</span>nAvgBytesPerSec <span style="color: #808030;">*</span> <span style="color: #008c00;">10</span><span style="color: #800080;">;</span>
<span style="color: #696969;">//pWaveHeader-&gt;dwUser = </span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwFlags <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span>
pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwLoops <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span>
<span style="color: #004a43;">#</span><span style="color: #004a43; font-weight: bold;">pragma </span><span style="color: #bb7977; font-weight: bold;">region Generate Actual Data</span>
<span style="color: #800080;">{</span>
    <span style="color: #603000;">SHORT</span><span style="color: #808030;">*</span> pnData <span style="color: #808030;">=</span> <span style="color: #808030;">(</span><span style="color: #603000;">SHORT</span><span style="color: #808030;">*</span><span style="color: #808030;">)</span> pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>lpData<span style="color: #800080;">;</span>
    SIZE_T nDataCount <span style="color: #808030;">=</span> pWaveHeader<span style="color: #808030;">-</span><span style="color: #808030;">&gt;</span>dwBufferLength <span style="color: #808030;">/</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pnData<span style="color: #800080;">;</span>
    <span style="color: #800000; font-weight: bold;">for</span><span style="color: #808030;">(</span>SIZE_T nIndex <span style="color: #808030;">=</span> <span style="color: #008c00;">0</span><span style="color: #800080;">;</span> nIndex <span style="color: #808030;">&lt;</span> nDataCount<span style="color: #800080;">;</span> nIndex<span style="color: #808030;">+</span><span style="color: #808030;">+</span><span style="color: #808030;">)</span>
    pnData<span style="color: #808030;">[</span>nIndex<span style="color: #808030;">]</span> <span style="color: #808030;">=</span> <span style="color: #808030;">(</span><span style="color: #603000;">SHORT</span><span style="color: #808030;">)</span> <span style="color: #808030;">(</span><span style="color: #008c00;">32000</span> <span style="color: #808030;">*</span> <span style="color: #603000;">sin</span><span style="color: #808030;">(</span><span style="color: #008000;">1.0</span> <span style="color: #808030;">*</span> nIndex <span style="color: #808030;">/</span> WaveFormatEx<span style="color: #808030;">.</span>nSamplesPerSec <span style="color: #808030;">*</span> nFrequency <span style="color: #808030;">*</span> <span style="color: #008c00;">2</span> <span style="color: #808030;">*</span> M_PI<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #800080;">}</span>
<span style="color: #004a43;">#</span><span style="color: #004a43; font-weight: bold;">pragma </span><span style="color: #bb7977; font-weight: bold;">endregion </span>
Check<span style="color: #808030;">(</span>waveOutPrepareHeader<span style="color: #808030;">(</span>hWaveOut<span style="color: #808030;">,</span> pWaveHeader<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pWaveHeader<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
Check<span style="color: #808030;">(</span>waveOutWrite<span style="color: #808030;">(</span>hWaveOut<span style="color: #808030;">,</span> pWaveHeader<span style="color: #808030;">,</span> <span style="color: #800000; font-weight: bold;">sizeof</span> <span style="color: #808030;">*</span>pWaveHeader<span style="color: #808030;">)</span><span style="color: #808030;">)</span><span style="color: #800080;">;</span>
<span style="color: #400000;">GlobalUnlock</span><span style="color: #808030;">(</span>hWaveHeader<span style="color: #808030;">)</span><span style="color: #800080;">;</span></pre>
<p>The operating system is supposed to mix the waves, which can be easily perceived taking place. It is possible to run the application with multiple waveforms within a process, e.g. &#8220;abc&#8221; command line parameter, and/or start multiple instances of the application.</p>
<p>A binary [<a href="http://www.alax.info/svn/public/trunk/Utilities/WaveOutMultiPlay/Release/WaveOutMultiPlay.exe">Win32</a>] and partial Visual C++ .NET 2010 <a href="http://www.alax.info/trac/public/browser/trunk/Utilities/WaveOutMultiPlay">source code</a> are available from SVN.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1291/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Utility Clearance: Enumerate Audio &#8216;MMDevice&#8217;s</title>
		<link>http://alax.info/blog/1279</link>
		<comments>http://alax.info/blog/1279#comments</comments>
		<pubDate>Tue, 30 Aug 2011 17:14:24 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[WTL]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Core Audio]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[IMMDevice]]></category>
		<category><![CDATA[MMDevice]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[WASAPI]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1279</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1279" title="Utility Clearance: Enumerate Audio &#039;MMDevice&#039;s"></a>The utility and code does straightforward enumeration of MMDevices (Vista+, check MSDN for MMDevice API availability), which correspond to MMDevice API, WASAPI, Core Audio API. The code itself is straightforward, with a ready to use binary to quickly lookup data &#8230;<p class="read-more"><a href="http://alax.info/blog/1279">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1279" title="Utility Clearance: Enumerate Audio &#039;MMDevice&#039;s"></a><p>The utility and code does straightforward enumeration of MMDevices (Vista+, check MSDN for <a href="http://msdn.microsoft.com/en-us/library/dd371399%28v=vs.85%29.aspx">MMDevice API availability</a>), which correspond to MMDevice API, WASAPI, Core Audio API. The code itself is straightforward, with a ready to use binary to quickly lookup data of interest:</p>
<p><img class="alignnone size-full wp-image-1280" title="Enumerate Audio Devices in Action" src="http://alax.info/blog/wp-content/uploads/2011/08/Image0012.png" alt="" width="541" height="363" /></p>
<p>The data is detailed well and in Excel-friendly format (via Copy/Paste):</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/08/Image002.png"><img class="alignnone size-large wp-image-1281" title="Enumerate Audio Device Output in Microsoft Excel" src="http://alax.info/blog/wp-content/uploads/2011/08/Image002-800x362.png" alt="" width="620" height="280" /></a></p>
<p>The code also automatically looks up for named Windows SDK constants, such as <a href="http://msdn.microsoft.com/en-us/library/dd316594%28v=vs.85%29.aspx">PKEY_Device_FriendlyName</a>:</p>
<pre>Â Â Â  IdentifierÂ Â  Â {0.0.1.00000000}.{4c1a7642-3f91-43e5-8fcf-b4b1e803d3f9}
Â Â  Â StateÂ Â  Â DEVICE_STATE_DISABLEDÂ Â  Â 0x02
Â Â  Â Properties:
Â Â  Â Â Â  Â {B3F8FA53-0004-438E-9003-51A46E139BFC}, 15Â Â  Â 16 bytes of BLOB, DA 07 03 00 02 00 09 00 0E 00 39 00 16 00 C5 02Â Â  Â 65
Â Â  Â Â Â  Â PKEY_Device_DeviceDescÂ Â  Â Stereo MixÂ Â  Â 31
Â Â  Â Â Â  Â {B3F8FA53-0004-438E-9003-51A46E139BFC}, 6Â Â  Â Realtek High Definition AudioÂ Â  Â 31
Â Â  Â Â Â  Â {B3F8FA53-0004-438E-9003-51A46E139BFC}, 2Â Â  Â {1}.HDAUDIO\FUNC_01&amp;VEN_10EC&amp;DEV_0888&amp;SUBSYS_80860034&amp;REV_1002\4&amp;37D44F2F&amp;0&amp;0201Â Â  Â 31
Â Â  Â Â Â  Â {83DA6326-97A6-4088-9453-A1923F573B29}, 3Â Â  Â oem29.inf:AzaliaManufacturerID.NTamd64.6.0:IntcAzAudModel:6.0.1.5964:hdaudio\func_01&amp;ven_10ec&amp;dev_0888Â Â  Â 31
Â Â  Â Â Â  Â PKEY_Device_BaseContainerIdÂ Â  Â {00000000-0000-0000-FFFF-FFFFFFFFFFFF}Â Â  Â 72
Â Â  Â Â Â  Â PKEY_Device_ContainerIdÂ Â  Â {00000000-0000-0000-FFFF-FFFFFFFFFFFF}Â Â  Â 72
Â Â  Â Â Â  Â PKEY_Device_EnumeratorNameÂ Â  Â HDAUDIOÂ Â  Â 31
Â Â  Â Â Â  Â PKEY_AudioEndpoint_FormFactorÂ Â  Â 10Â Â  Â 19
Â Â  Â Â Â  Â PKEY_AudioEndpoint_JackSubTypeÂ Â  Â {DFF21FE1-F70F-11D0-B917-00A0C9223196}Â Â  Â 31
Â Â  Â Â Â  Â PKEY_DeviceClass_IconPathÂ Â  Â %windir%\system32\mmres.dll,-3018Â Â  Â 31
Â Â  Â Â Â  Â {840B8171-B0AD-410F-8581-CCCC0382CFEF}, 0Â Â  Â 316 bytes of BLOB, 01 00 00 00 38 01 00 00 ... 00 00 00 00Â Â  Â 65
Â Â  Â Â Â  Â PKEY_AudioEndpoint_AssociationÂ Â  Â {00000000-0000-0000-0000-000000000000}Â Â  Â 31
Â Â  Â Â Â  Â PKEY_AudioEndpoint_Supports_EventDriven_ModeÂ Â  Â 1Â Â  Â 19
Â Â  Â Â Â  Â {24DBB0FC-9311-4B3D-9CF0-18FF155639D4}, 3Â Â  Â 0Â Â  Â 11
Â Â  Â Â Â  Â {24DBB0FC-9311-4B3D-9CF0-18FF155639D4}, 4Â Â  Â -1Â Â  Â 11
Â Â  Â Â Â  Â {9A82A7DB-3EBB-41B4-83BA-18B7311718FC}, 1Â Â  Â 65536Â Â  Â 19
Â Â  Â Â Â  Â {233164C8-1B2C-4C7D-BC68-B671687A2567}, 1Â Â  Â {2}.\\?\hdaudio#func_01&amp;ven_10ec&amp;dev_0888&amp;subsys_80860034&amp;rev_1002#4&amp;37d44f2f&amp;0&amp;0201#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\rtstereomixwaveÂ Â  Â 31
Â Â  Â Â Â  Â {5A9125B7-F367-4924-ACE2-0803A4A3A471}, 0Â Â  Â 1610612916Â Â  Â 19
Â Â  Â Â Â  Â {B3F8FA53-0004-438E-9003-51A46E139BFC}, 0Â Â  Â 3Â Â  Â 19
<span style="color: #3366ff;"><strong>Â Â  Â Â Â  Â PKEY_Device_FriendlyNameÂ Â  Â Stereo Mix (Realtek High Definition Audio)Â Â  Â 31</strong></span>
Â Â  Â Â Â  Â PKEY_DeviceInterface_FriendlyNameÂ Â  Â Realtek High Definition AudioÂ Â  Â 31
Â Â  Â Â Â  Â PKEY_AudioEndpoint_GUIDÂ Â  Â {4C1A7642-3F91-43E5-8FCF-B4B1E803D3F9}Â Â  Â 31</pre>
<p>A binary [<a href="http://www.alax.info/svn/public/trunk/Utilities/EnumerateAudioDevices/_Bin/Win32/Release/EnumerateAudioDevices.exe">Win32</a>, <a href="http://www.alax.info/svn/public/trunk/Utilities/EnumerateAudioDevices/_Bin/x64/Release/EnumerateAudioDevices.exe">x64</a>] and partial Visual C++ .NET 2010 <a href="http://www.alax.info/trac/public/browser/trunk/Utilities/EnumerateAudioDevices">source code</a> are available from SVN.</p>
<p>See also:</p>
<ul>
<li><a href="http://blogs.msdn.com/b/matthew_van_eerde/archive/2011/06/13/how-to-enumerate-audio-endpoint-immdevice-properties-on-your-system.aspx">A similar tool with source code</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/dd371400%28v=VS.85%29.aspx">IMMDeviceEnumerator::EnumAudioEndpoints</a> on MSDN</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1279/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Utility Clearance: Generate PCM .WAV File</title>
		<link>http://alax.info/blog/1274</link>
		<comments>http://alax.info/blog/1274#comments</comments>
		<pubDate>Thu, 25 Aug 2011 20:48:13 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[.WAV]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[dB]]></category>
		<category><![CDATA[generation]]></category>
		<category><![CDATA[Loudness]]></category>
		<category><![CDATA[PCM]]></category>
		<category><![CDATA[sine]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[wavdest]]></category>
		<category><![CDATA[waveform]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1274</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1274" title="Utility Clearance: Generate PCM .WAV File"></a>GeneratePcmWavFile tool is generating PCM .WAV files with requested parameters, silent or with a sine wave data. The utility uses WavDest SDK Sample as a multiplexer, so it is expected to be available. It is possible to define the following &#8230;<p class="read-more"><a href="http://alax.info/blog/1274">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1274" title="Utility Clearance: Generate PCM .WAV File"></a><p>GeneratePcmWavFile tool is generating PCM .WAV files with requested parameters, silent or with a sine wave data. The utility uses <a href="http://msdn.microsoft.com/en-us/library/dd390969%28v=vs.85%29.aspx">WavDest SDK Sample</a> as a multiplexer, so it is expected to be available.</p>
<p>It is possible to define the following audio data parameters:</p>
<ul>
<li>sampling frequency, number of samples per second, such as 44100 or 48000</li>
<li>number of channels; the utility does not constrain this to be stereo or 5.1, it will be able to create 64 or 128 channel audio data as well</li>
<li>8 or 16 bit audio samples</li>
<ul>
<li>16-bit PCM only: sine wave signal parameters, frequency in Hz and amplitude/loudness relative to full scale, that is 0 dB is maximal loudness, and an argument of 23 will result in -23 dB loud audio (such as -23 dbFS, also see <a href="http://tech.ebu.ch/loudness">EBU R128 Specification</a>, the signal depending on frequency may be used a reference source for normalized -23 LUFS audio)</li>
</ul>
<li>file duration in seconds</li>
</ul>
<pre>Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.Â  All rights reserved.

C:\&gt;GeneratePcmWavFile.exe
Syntax: GeneratePcmWavFile &lt;options&gt; &lt;output-path&gt;
Â  /s:N: Sampling Rate N, Hz
Â  /c:N: Channel Count N
Â  /b:N: Sample Bit Count N, 8 or 16
Â  /t:N: Length N, seconds
Â  /f:N: Sine Signal Frequency N, Hz
Â  /l:N: Sine Signal Loudness N, dB below full scale
  /n:N: Noise Signal Loudness N, dB below full scale</pre>
<p><a href="http://alax.info/blog/wp-content/uploads/2011/08/Image0011.png"><img class="alignnone size-medium wp-image-1275" title="-23 dBFS Generated Audio Playback" src="http://alax.info/blog/wp-content/uploads/2011/08/Image0011-320x248.png" alt="" width="320" height="248" /></a></p>
<p>A binary [<a href="http://alax.info/trac/public/browser/trunk/Utilities/GeneratePcmWavFile/Win32/Release/GeneratePcmWavFile.exe?format=raw">Win32</a>] and partial Visual C++ .NET 2010 <a href="http://alax.info/trac/public/browser/trunk/Utilities/GeneratePcmWavFile">source code</a> are available from SVN.</p>
<p>UPDATE: An extra /n parameter lets the application add random noise within provided loudness parameter.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1274/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adobe Flash Media Live Encoder 3.1</title>
		<link>http://alax.info/blog/1138</link>
		<comments>http://alax.info/blog/1138#comments</comments>
		<pubDate>Sat, 24 Jul 2010 08:02:59 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[adobe]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[dshow]]></category>
		<category><![CDATA[flash]]></category>
		<category><![CDATA[FMLE]]></category>
		<category><![CDATA[garbage]]></category>
		<category><![CDATA[media]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1138</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1138" title="Adobe Flash Media Live Encoder 3.1"></a>It is the first time ever &#8211; because probably I am not as experienced as Geraint &#8211; I witness availability of IMediaSample interface without availability of IMediaSample2. One might be curious what kind of software could provide such a weirdo &#8230;<p class="read-more"><a href="http://alax.info/blog/1138">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1138" title="Adobe Flash Media Live Encoder 3.1"></a><p>It is the first time ever &#8211; because probably I am not as experienced as <a href="http://www.gdcl.co.uk/">Geraint</a> &#8211; I witness availability of <a href="http://msdn.microsoft.com/en-us/library/dd407001%28VS.85%29.aspx">IMediaSample</a> interface without availability of <a href="http://msdn.microsoft.com/en-us/library/dd407002%28VS.85%29.aspx">IMediaSample2</a>. One might be curious what kind of software could provide such a weirdo in 2010? It is latest and greatest <a href="http://www.adobe.com/products/flashmediaserver/flashmediaencoder/">Adobe Flash Media Live Encoder 3.1</a>.</p>
<p>Additionally to this, they decided to provide garbage in <a href="http://msdn.microsoft.com/en-us/library/dd373477%28VS.85%29.aspx">AM_MEDIA_TYPE</a>::formattype field of <a href="http://msdn.microsoft.com/en-us/library/dd319788%28VS.85%29.aspx">IAMStreamConfig::SetFormat</a>. They perhaps learned that standard <a href="http://msdn.microsoft.com/en-us/library/dd317587%28VS.85%29.aspx">Audio Capture Filter</a> will ignore it anyway, so why bother then?</p>
<p>Having fixed that, <a href="http://alax.info/blog/859">Tone Source Filter</a> based virtual audio device is now compatible with <a href="http://www.adobe.com/products/flashmediaserver/flashmediaencoder/">Adobe Flash Media Live Encoder 3.1</a> and it is possible to send audio to remote Flash Media Server, e.g. such as <a href="http://www.ustream.tv/">Ustream.tv</a> service (over <a href="http://en.wikipedia.org/wiki/Real_Time_Messaging_Protocol">RTMP protocol</a>, as implemented by FMLE).</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2010/07/24-Image002.png"><img class="alignnone size-medium wp-image-1143" title="24-Image002" src="http://alax.info/blog/wp-content/uploads/2010/07/24-Image002-320x240.png" alt="24-Image002" width="320" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1138/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectShow Spy: Filter Mapper Spy</title>
		<link>http://alax.info/blog/1100</link>
		<comments>http://alax.info/blog/1100#comments</comments>
		<pubDate>Thu, 24 Dec 2009 13:07:50 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[hook]]></category>
		<category><![CDATA[mapper]]></category>
		<category><![CDATA[spy]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1100</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1100" title="DirectShow Spy: Filter Mapper Spy"></a>DirectShow Filter Graph Spy was updated to add new functionality: spying over another DirectShow object &#8211; Filter Mapper. Filter Mapper object is used for filter registration purposes and also internally by DirectShow&#8217;s Intelligent Connect. IFilterMapper2 interface traces provide detailed description &#8230;<p class="read-more"><a href="http://alax.info/blog/1100">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1100" title="DirectShow Spy: Filter Mapper Spy"></a><p><a href="http://alax.info/blog/777">DirectShow Filter Graph Spy</a> was updated to add new functionality: spying over another DirectShow object &#8211; <a href="http://msdn.microsoft.com/en-us/library/dd375788%28VS.85%29.aspx">Filter Mapper</a>. Filter Mapper object is used for filter registration purposes and also internally by DirectShow&#8217;s <a href="http://msdn.microsoft.com/en-us/library/ms940065.aspx">Intelligent Connect</a>. <a href="http://msdn.microsoft.com/en-us/library/dd390033%28VS.85%29.aspx">IFilterMapper2</a> interface traces provide detailed description on steps DirectShow takes in order to connect and/or render filter pins. For example when trying to render <em>MEDIATYPE_Audio</em> pin, Filter Mapper suggested &#8220;RDP DShow Redirection Filter&#8221; and, then, &#8220;Default DirectSound Device&#8221;:</p>
<pre style="background: #ffffff none repeat scroll 0% 0%; color: #000000;">FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">186</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> nFlags 0x0<span style="color: #808030;">,</span> bExactMatch <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nMinimalMerit 0x00200001<span style="color: #808030;">,</span> bInputNeeded <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> nInputTypeCount <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> pInputPinCategory NULL<span style="color: #808030;">,</span> bRender <span style="color: #008c00;">1</span><span style="color: #808030;">,</span> bOutputNeeded <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> nOutputTypeCount <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> pOutputPinCategory NULL
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">191</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> nInputTypeIndex <span style="color: #008c00;">0</span><span style="color: #808030;">,</span> MajorType <span style="color: #808030;">{</span><span style="color: #008c00;">73647561</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0010</span><span style="color: #808030;">-</span><span style="color: #008c00;">8000</span><span style="color: #808030;">-</span>00AA00389B71<span style="color: #808030;">}</span><span style="color: #808030;">,</span> Subtype <span style="color: #808030;">{</span><span style="color: #008c00;">00000000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">0000</span><span style="color: #808030;">-</span><span style="color: #008c00;">000000000000</span><span style="color: #808030;">}</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">212</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> pMoniker @device<span style="color: #808030;">:</span>sw<span style="color: #808030;">:</span><span style="color: #808030;">{</span>083863F1<span style="color: #808030;">-</span>70DE<span style="color: #808030;">-</span>11D0<span style="color: #808030;">-</span>BD40<span style="color: #808030;">-</span>00A0C911CE86<span style="color: #808030;">}</span><span style="color: #808030;">\</span><span style="color: #808030;">{</span>AB9D6472<span style="color: #808030;">-</span>752F<span style="color: #808030;">-</span>43F6<span style="color: #808030;">-</span>B29E<span style="color: #808030;">-</span>61207BDA8E06<span style="color: #808030;">}</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">220</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> sFriendlyName <span style="color: #800000;">"</span><span style="color: #0000e6;">RDP DShow Redirection Filter</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDescription <span style="color: #800000;">"</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDevicePath <span style="color: #800000;">"</span><span style="color: #800000;">"</span>
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">212</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> pMoniker @device<span style="color: #808030;">:</span>cm<span style="color: #808030;">:</span><span style="color: #808030;">{</span>E0F158E1<span style="color: #808030;">-</span>CB04<span style="color: #808030;">-</span>11D0<span style="color: #808030;">-</span>BD4E<span style="color: #808030;">-</span>00A0C911CE86<span style="color: #808030;">}</span><span style="color: #808030;">\</span>Default DirectSound Device
FilterMapperSpy<span style="color: #008c00;">.</span>h<span style="color: #808030;">(</span><span style="color: #008c00;">220</span><span style="color: #808030;">)</span><span style="color: #808030;">:</span> CFilterMapperSpy<span style="color: #808030;">:</span><span style="color: #808030;">:</span>EnumMatchingFilters<span style="color: #808030;">:</span> sFriendlyName <span style="color: #800000;">"</span><span style="color: #0000e6;">Default DirectSound Device</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDescription <span style="color: #800000;">"</span><span style="color: #800000;">"</span><span style="color: #808030;">,</span> sDevicePath <span style="color: #800000;">"</span><span style="color: #800000;">"</span></pre>
<p>Important is that DirectShow&#8217;s internals are using the mapper through COM instantiation and this provides a safe method to override default behavior process wide in order to, for example, extend <a href="http://msdn.microsoft.com/en-us/library/ms940065.aspx">Intelligent Connect</a> functionality onto custom, unregistered globally, private filters.</p>
<p>Also, the binary is renamed from FilterGraphSpy.dll to DirectShowSpy.dll.</p>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy">available from SVN</a>, release binary included (<a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/Win32/DirectShowSpy.dll?format=raw">Win32</a>, <a href="http://www.assembla.com/code/roatl-utilities/subversion/nodes/trunk/FilterGraphSpy/Release%20Trace/x64/DirectShowSpy.dll?format=raw">x64</a>); installation instructions are in <a href="./777">another post</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1100/feed</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Windows Media Codec List</title>
		<link>http://alax.info/blog/1025</link>
		<comments>http://alax.info/blog/1025#comments</comments>
		<pubDate>Fri, 28 Aug 2009 16:58:47 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Utilities]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[WTL]]></category>
		<category><![CDATA[codec]]></category>
		<category><![CDATA[utility]]></category>
		<category><![CDATA[windows media]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=1025</guid>
		<description><![CDATA[<a href="http://alax.info/blog/1025" title="Windows Media Codec List"></a>Windows Media Codec List utility uses IWMCodecInfo interface (see also IWMCodecInfo2, IWMCodecInfo3) lists installed Windows Media Codecs and their formats and presents the findings in a convenient way. The utility gives a quick idea what a programmer would obtain through &#8230;<p class="read-more"><a href="http://alax.info/blog/1025">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/1025" title="Windows Media Codec List"></a><p>Windows Media Codec List utility uses <a href="http://msdn.microsoft.com/en-us/library/dd743313%28VS.85%29.aspx">IWMCodecInfo</a> interface (see also <a href="http://msdn.microsoft.com/en-us/library/dd743314(VS.85).aspx">IWMCodecInfo2</a>, <a href="http://msdn.microsoft.com/en-us/library/dd743317(VS.85).aspx">IWMCodecInfo3</a>) lists installed <a href="http://www.microsoft.com/windows/windowsmedia/default.mspx">Windows Media</a> Codecs and their formats and presents the findings in a convenient way. The utility gives a quick idea what a programmer would obtain through <a href="http://msdn.microsoft.com/en-us/library/dd743314(VS.85).aspx">IWMCodecInfo2</a>/<a href="http://msdn.microsoft.com/en-us/library/dd743317(VS.85).aspx">IWMCodecInfo3</a> interfaces and what well known format structures (<a href="http://msdn.microsoft.com/en-us/library/dd757963%28VS.85%29.aspx">WM_MEDIA_TYPE</a>, <a href="http://msdn.microsoft.com/en-us/library/dd373477%28VS.85%29.aspx">AM_MEDIA_TYPE</a>, <a href="http://msdn.microsoft.com/en-us/library/dd757720%28VS.85%29.aspx">WAVEFORMATEX</a>, <a href="http://msdn.microsoft.com/en-us/library/dd407325%28VS.85%29.aspx">VIDEOINFOHEADER</a>) correspond to particular format.</p>
<p>For a description of Windows Media video and audio codecs, check article <a href="http://www.microsoft.com/windows/windowsmedia/howto/articles/codecs.aspx">Encoding Audio and Video with Windows Media Codecs</a>.</p>
<p><a href="http://alax.info/blog/wp-content/uploads/2009/08/28-image001.png"><img class="size-medium wp-image-1024 alignnone" title="Windows Media Codec List Screenshot" src="http://alax.info/blog/wp-content/uploads/2009/08/28-image001-320x171.png" alt="Windows Media Codec List Screenshot" width="320" height="171" /></a></p>
<p>Copy button copies discovered information into clipboard in comma-separated values (CSV) format (e.g. suitable fo rMicrosoft Excel). Submit button posts the same information to this website for&#8230; possibly further aggregation.</p>
<p>Some quick facts immediately visualized by the utility:</p>
<ul>
<li>for a video codec there is exactly one generic codec format listed</li>
<li>video codec FOUCCs are: WM Video &#8211; WMV1, WMV2, WMV3; WM Video Screen &#8211; MSS1, MSS2; WM Video Image &#8211; WMVP, WVP2; WM Video Advanced Profile &#8211; WVC1</li>
<li>for audio codecs there are complete codec formats enumerated, with names/descriptions suitable for GUI</li>
<li>audio codecs enumerate different formats in response to enumeration settings (e.g. request for VBR formats)</li>
<li>WM Audio Lossless only lists formats for single pass VBR mode</li>
<li>audio format tags (wFormatTag) are: WM Audio including Professional and Lossless &#8211; 0&#215;0161, 0&#215;0162, 0&#215;0163; WM Audio Voice &#8211; 0x000A; ACELP.net &#8211; 0&#215;0130</li>
</ul>
<p>Partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/WindowsMediaCodecList">available from SVN</a>, release binary <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/WindowsMediaCodecList/Release/WindowsMediaCodecList.exe?format=raw">included</a>.</p>
<p><span id="more-1025"></span>See also:</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/VC-1">VC-1 on Wikipedia</a>:</li>
<li>
<blockquote><p><strong>WMV3</strong></p>
<p>Simple and Main Profiles of VC-1 remained completely faithful to the existing WMV3 implementation, making WMV3 bitstreams fully VC-1 compliant. The WMV3 codec was designed to primarily support progressive encoding for computer displays. An interlaced encoding mode was implemented, but quickly became deprecated when Microsoft started implementing WMV Advanced Profile. Whereas WMV3 progressive encoding was implemented in the YUV 4:2:0 color space, the deprecated interlaced mode was implemented in the less common YUV 4:1:1 color space.</p>
<p>The Windows Media Video 9 (WMV3) codec implements the Simple and Main modes of the VC-1 codec standard, providing high-quality video for streaming and downloading. &#8220;It provides support for a wide range of bit rates, from high-definition content at one-half to one-third the bit rate of MPEG-2, to low-bit-rate Internet video delivered over a dial-up modem. This codec also supports professional-quality downloadable video with two-pass and variable bit rate (VBR) encoding. Windows Media Video 9 is already supported by a wide variety of players and devices.&#8221;[citation needed]</p>
<p>A number of high definition movies and videos have been released commercially in a format dubbed WMV HD. These titles are encoded with WMV3 Main Profile @ High Level (MP@HL).</p>
<p>[...]</p>
<p><strong>WVC1</strong></p>
<p>WVC1, also known as Windows Media Video 9 Advanced Profile, implements a more recent and fully compliant Advanced Profile of the VC-1 codec standard. It offers support for interlaced content and is transport independent. With the previous version of the Windows Media Video 9 Series codec, users could deliver progressive content at data rates as low as one-third that of the MPEG-2 codec and still get equivalent or comparable quality to MPEG-2. The Windows Media Video 9 Advanced Profile codec also offers this same improvement in encoding efficiency with interlaced contents. A decoder for WVC1 is included in Windows Media Player 11, which is bundled with Windows Vista and is <a href="http://www.microsoft.com/downloads/details.aspx?displaylang=en&amp;FamilyID=1d224714-e238-4e45-8668-5166114010ca">available as a download for Windows XP</a>.</p></blockquote>
</li>
<li><a href="http://en.wikipedia.org/wiki/Windows_Media_Audio">Windows Media Audio on Wikipedia</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/1025/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MediaTools: Tone Source Filter to generate reference audio feed, dual Audio Source Filter and Virtual Audio Capture Device</title>
		<link>http://alax.info/blog/859</link>
		<comments>http://alax.info/blog/859#comments</comments>
		<pubDate>Sat, 28 Feb 2009 09:40:19 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Media Tools]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[WTL]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[capture]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[DirectShow]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[PCM]]></category>
		<category><![CDATA[tone]]></category>
		<category><![CDATA[virtual]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=859</guid>
		<description><![CDATA[<a href="http://alax.info/blog/859" title="MediaTools: Tone Source Filter to generate reference audio feed, dual Audio Source Filter and Virtual Audio Capture Device"></a>In order to obtain a reference audio source and especially useful for debugging purposes, including: audio input device unrelated to physical device, to avoid conditions when device is already in use by someone else non-zero audio signal which is independent &#8230;<p class="read-more"><a href="http://alax.info/blog/859">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/859" title="MediaTools: Tone Source Filter to generate reference audio feed, dual Audio Source Filter and Virtual Audio Capture Device"></a><p>In order to obtain a reference audio source and especially useful for debugging purposes, including:</p>
<ul>
<li>audio input device unrelated to physical device, to avoid conditions when device is already in use by someone else</li>
<li>non-zero audio signal which is independent of certain speaker or broadcasting service, including one that makes capture, transmission or rendering issues easily perceptible by human</li>
<li>configurable to provide different audio media types, including through well known DirectShow interfaces, such as <a href="http://msdn.microsoft.com/en-us/library/dd319784(VS.85).aspx">IAMStreamConfig</a></li>
<li>configurable to present in system as both regular <a href="http://msdn.microsoft.com/en-us/library/dd375464(VS.85).aspx">DirectShow Filter</a>, and as an <a href="http://msdn.microsoft.com/en-us/library/dd375655(VS.85).aspx">Audio Capture Source</a> which can be enumerated by applications</li>
<li>to be able to check how exactly other applications are accessing and configuring audio capture source</li>
</ul>
<p>I added a new filter to the Media Tools library, a Tone Source Filter. The filter generates <a href="http://en.wikipedia.org/wiki/Pulse-code_modulation">PCM Audio</a> data, either infinite sine waveform, or interrupted signal  of requested parameters:</p>
<p><img class="alignnone size-full wp-image-863" title="Tone Source Filter General Property Page" src="http://alax.info/blog/wp-content/uploads/2009/02/27-image011.png" alt="Tone Source Filter General Property Page" width="370" height="428" /></p>
<p>The filter accepts connection on <a href="http://en.wikipedia.org/wiki/Pulse-code_modulation">PCM</a> media types with flexible sampling rates in range 8 KHz through 200 KHz, 8-bit audio and 1 channel. Media type is also configurable through or, if not configured this way, the first enumerated media type off the Output pin is also configurable through property page and/or persistent setting accessible via private IDispatch derived interface property.</p>
<p><img class="alignnone size-full wp-image-864" title="Tone Source Filter Prefered Format Property Page" src="http://alax.info/blog/wp-content/uploads/2009/02/27-image012.png" alt="Tone Source Filter Prefered Format Property Page" width="370" height="427" /></p>
<p>Additionally, the filter may configured as a system-wide available <a href="http://msdn.microsoft.com/en-us/library/ms783347(VS.85).aspx">audio input device</a>, such as for example available to <a href="http://videolan.org">VLC Media Player</a> or <a href="http://sourceforge.net/projects/guliverkli/">Media Player Classic</a>:</p>
<p><img class="alignnone size-full wp-image-865" title="VLC Media Player's Option to use Tone Source Filter based device" src="http://alax.info/blog/wp-content/uploads/2009/02/27-image013.png" alt="VLC Media Player's Option to use Tone Source Filter based device" width="528" height="352" /></p>
<p>In order to configure the filter as such device, the library exports function <em>DoToneSourceFilterDevicePropertySheetModal</em>, which can be called using <em>rundll32</em> utility (<em>&#8220;rundll32 Acquisition.dll,DoToneSourceFilterDevicePropertySheetModal&#8221;</em> from command line):</p>
<p><img class="alignnone size-full wp-image-866" title="Devices Property Page" src="http://alax.info/blog/wp-content/uploads/2009/02/27-image014.png" alt="Devices Property Page" width="367" height="426" /></p>
<p>A partial Visual C++ .NET 2008 source code is <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/Extended7zShell">available from SVN</a>, release binary <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/MediaTools/_Bin/Release%20Trace/Acquisition.dll?format=raw">included</a>.</p>
<h2>File and Class Summary</h2>
<h3>Acqusition.dll</h3>
<p>Acqusition.dll (<a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/MediaTools/_Bin/Release%20Trace/Acquisition.dll?format=raw">download</a>) hosts the following classes:</p>
<ul>
<li>DirectShow Filters
<ul>
<li><span style="text-decoration: underline;">Tone Source Filter</span>, to generate reference/debug audio data</li>
</ul>
</li>
</ul>
<h2>Class Overview</h2>
<h3>Tone Source Filter</h3>
<p>The filter generates uninterrupted or interrupted reference sine waveform in form of PCM audio data.</p>
<ul>
<li>Filter Executable: Acquisition.dll</li>
<li>Filter CLSID: __uuidof(ToneSourceFilter) {8002935A-B2EC-40ef-968C-E0358E5DED10}</li>
<li>Filter Property Page CLSID: __uuidof(ToneSourceFilterGeneralPropertyPage), {EBD8ABB2-6DD3-4c54-A7F1-9FE4DA283EDF}, ToneSourceFilterPreferedFormatPropertyPage, {EE224187-4FA3-4c3f-9D5D-492694CCFEB7}</li>
<li>Filter Merit: <a href="http://msdn.microsoft.com/en-us/library/ms787275%28VS.85%29.aspx">MERIT_DO_NOT_USE</a></li>
<li>Filter Category: <a href="http://msdn.microsoft.com/en-us/library/ms783347%28VS.85%29.aspx">CLSID_LegacyAmFilterCategory</a> (also configurable as <a href="http://msdn.microsoft.com/en-us/library/ms783347(VS.85).aspx">CLSID_AudioInputDeviceCategory</a>)</li>
<li>Filter Interfaces: <a href="http://msdn.microsoft.com/en-us/library/ms682273%28VS.85%29.aspx">IPersistStreamInit</a>, <a href="http://msdn.microsoft.com/en-us/library/ms690091%28VS.85%29.aspx">IPersistStream</a>, <a href="http://msdn.microsoft.com/en-us/library/ms695217%28VS.85%29.aspx">ISpecifyPropertyPages</a>, <a href="http://msdn.microsoft.com/en-us/library/aa768205(VS.85).aspx">IPersistPropertyBag</a>, <a href="http://msdn.microsoft.com/en-us/library/ms784601%28VS.85%29.aspx">IBaseFilter</a>, <a href="http://msdn.microsoft.com/en-us/library/ms785914%28VS.85%29.aspx">IMediaFilter</a>, <a href="http://msdn.microsoft.com/en-us/library/ms688695%28VS.85%29.aspx">IPersist</a>, <a href="http://msdn.microsoft.com/en-us/library/ms784083%28VS.85%29.aspx">IAMovieSetup</a>, <a href="http://msdn.microsoft.com/en-us/library/ms783950%28VS.85%29.aspx">IAMFilterMiscFlags</a>, IToneSourceFilter, <a href="http://msdn.microsoft.com/en-us/library/ms221608.aspx">IDispatch</a></li>
<li>Filter Pins: single ouput pin (Ouput)</li>
<li>Output Pin Media Types: MEDIATYPE_Audio/MEDIASUBTYPE_PCM</li>
<li>Output Pin Interfaces: <a href="http://msdn.microsoft.com/en-us/library/ms786565%28VS.85%29.aspx">IPin</a>, <a href="http://msdn.microsoft.com/en-us/library/ms786054%28VS.85%29.aspx">IMemInputPin</a>, <a href="http://msdn.microsoft.com/en-us/library/dd319764(VS.85).aspx">IAMPushSource</a>, <a href="http://msdn.microsoft.com/en-us/library/dd389383(VS.85).aspx">IAMLatency</a>, <a href="http://msdn.microsoft.com/en-us/library/dd389142(VS.85).aspx">IAMBufferNegotiation</a>, <a href="http://msdn.microsoft.com/en-us/library/bb174586(VS.85).aspx">IKsPropertySet</a>, <a href="http://msdn.microsoft.com/en-us/library/dd319784(VS.85).aspx">IAMStreamConfig</a></li>
</ul>
<h4>Remarks</h4>
<p>The hosting library (DLL) exposes <em>DoToneSourceFilterDevicePropertySheetModal</em> function which provides GUI to configure the filter as one or more audio capture source device, which can be enumerated by <a href="http://msdn.microsoft.com/en-us/library/dd407180(VS.85).aspx">System Device Enumerator</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/859/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Confusing AUDIO_STREAM_CONFIG_CAPS</title>
		<link>http://alax.info/blog/849</link>
		<comments>http://alax.info/blog/849#comments</comments>
		<pubDate>Sat, 21 Feb 2009 14:06:13 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Seriously]]></category>
		<category><![CDATA[crap]]></category>
		<category><![CDATA[intel]]></category>
		<category><![CDATA[realtek]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=849</guid>
		<description><![CDATA[<a href="http://alax.info/blog/849" title="Confusing AUDIO_STREAM_CONFIG_CAPS"></a>I don&#8217;t have any idea who makes software nowadays, but how can it expected to be reliable? Intel DG33FBC motherboard, onboard Realtek ALC888 High Definition Audio. I am tracing AUDIO_STREAM_CONFIG_CAPS capabilities reported by onboard audio capture board, one of them: &#8230;<p class="read-more"><a href="http://alax.info/blog/849">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/849" title="Confusing AUDIO_STREAM_CONFIG_CAPS"></a><p>I don&#8217;t have any idea who makes software nowadays, but how can it expected to be reliable?</p>
<p><a href="http://www.intel.com/Products/Desktop/Motherboards/DG33FB/DG33FB-overview.htm">Intel DG33FBC motherboard</a>, onboard Realtek ALC888 High Definition Audio. I am tracing <a href="http://msdn.microsoft.com/en-us/library/dd317597(VS.85).aspx">AUDIO_STREAM_CONFIG_CAPS</a> capabilities reported by onboard audio capture board, one of them:</p>
<p><a href="http://msdn.microsoft.com/en-us/library/dd373477(VS.85).aspx">AM_MEDIA_TYPE</a>:</p>
<pre>majortype {73647561-0000-0010-8000-00AA00389B71}, subtype {00000001-0000-0010-8000-00AA00389B71}, pUnk 0x00000000
bFixedSizeSamples 1, bTemporalCompression 0, lSampleSize 4
formattype {05589F81-C356-11CE-BF01-00AA0055595A}, cbFormat 18, pbFormat 0x002911a8
pbFormat as <a href="http://msdn.microsoft.com/en-us/library/ms713497(VS.85).aspx">WAVEFORMATEX</a>:
  wFormatTag 1
  nChannels 2
<span style="color: #0000ff;"><strong>  nSamplesPerSec 8000</strong>
</span>  nAvgBytesPerSec 32000
  nBlockAlign 4
  wBitsPerSample 16
  cbSize 0</pre>
<p><a href="http://msdn.microsoft.com/en-us/library/dd317597(VS.85).aspx">AUDIO_STREAM_CONFIG_CAPS</a>:</p>
<pre>guid {73647561-0000-0010-8000-00AA00389B71}
MinimumChannels 1, MaximumChannels 2, ChannelsGranularity 1
MinimumBitsPerSample 8, MaximumBitsPerSample 16, BitsPerSampleGranularity 8
<strong><span style="color: #ff0000;">MinimumSampleFrequency 11025, MaximumSampleFrequency 44100, SampleFrequencyGranularity 11025</span></strong></pre>
<p>Media type sampling frequency is 8 KHz (correct) but associated capabilities structure still report different sampling rates and granularity (crap), it is in fact 11025..44100 Hz for all capabilities, including those with sampling frequencies from a different row.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/849/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Multichannel audio recording</title>
		<link>http://alax.info/blog/724</link>
		<comments>http://alax.info/blog/724#comments</comments>
		<pubDate>Tue, 02 Dec 2008 20:37:09 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[Audio]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[multichannel]]></category>
		<category><![CDATA[PCM]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=724</guid>
		<description><![CDATA[<a href="http://alax.info/blog/724" title="Multichannel audio recording"></a>There has been recently an interesting post &#8220;Problem playing back multi-channel wave file under vista&#8221; on DirectShow Development forum about certain hardware that is capable of recording 64 channels of audio in 24-bit per sample PCM quality, with a sample &#8230;<p class="read-more"><a href="http://alax.info/blog/724">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/724" title="Multichannel audio recording"></a><p>There has been recently an interesting post &#8220;<a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=4175797&amp;SiteID=1"><span id="_ctl0_MainContent_PostFlatView"><span id="_ctl0_MainContent_PostFlatView__ctl0_PostSubject" class="forumName">Problem playing back multi-channel wave file under vista</span></span></a>&#8221; on <a href="http://forums.microsoft.com/MSDN/ShowForum.aspx?ForumID=129&amp;SiteID=1">DirectShow Development forum</a> about certain hardware that is capable of recording 64 channels of audio in 24-bit per sample <a href="http://en.wikipedia.org/wiki/Pulse-code_modulation">PCM</a> quality, with a sample recorded .WAV file posted.</p>
<p>I was curious what kind of hardware implements such recording. Google suggests it could be <a href="http://www.sadie.com/products/pcm-h64/main.php">PCM H64 multichannel system</a> from <a href="http://www.sadie.com/sadie_home.php">Sadie, UK</a>.</p>
<p>This is definitely an interesting piece of hardware which can fill normally video&#8217;s bandwidth with audio only data. BTW, some <a href="http://code.assembla.com/roatl-utilities/subversion/nodes/trunk/Play64ChannelWaveFile">useful related C++/DirectShow code is here</a> on new Assembla&#8217;s web itnerface into subversion repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/724/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DirectSound play buffer notification (IDirectSoundNotify8)</title>
		<link>http://alax.info/blog/682</link>
		<comments>http://alax.info/blog/682#comments</comments>
		<pubDate>Tue, 11 Nov 2008 07:49:30 +0000</pubDate>
		<dc:creator>Roman</dc:creator>
				<category><![CDATA[ATL]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Source]]></category>
		<category><![CDATA[DirectSound]]></category>
		<category><![CDATA[DirectX]]></category>

		<guid isPermaLink="false">http://alax.info/blog/?p=682</guid>
		<description><![CDATA[<a href="http://alax.info/blog/682" title="DirectSound play buffer notification (IDirectSoundNotify8)"></a>IDirectSoundNotify8 is an interface to get notified on playback on capture audio buffer reaching certain position in the buffer. It is a must thing when implementing ring buffers with new data continuously added to the buffer for seamless playback (continuously &#8230;<p class="read-more"><a href="http://alax.info/blog/682">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<a href="http://alax.info/blog/682" title="DirectSound play buffer notification (IDirectSoundNotify8)"></a><p><a href="http://msdn.microsoft.com/en-us/library/bb174483(VS.85).aspx">IDirectSoundNotify8</a> is an interface to get notified on playback on capture audio buffer reaching certain position in the buffer. It is a must thing when implementing ring buffers with new data continuously added to the buffer for seamless playback (continuously copied from in case of capture).</p>
<p>This project is a minimalistic C++ sample code to illustrate the API. To initialize the DirectSound subsystem it is required to provide a window handle, which is created using ATL&#8217;s <a href="http://msdn.microsoft.com/en-us/library/h4616bh2.aspx">CWindowImpl</a> (CMessageOnlyWindowImpl).</p>
<pre>...
ATLENSURE_SUCCEEDED(DirectSoundCreate8(NULL, &amp;pDirectSound8, NULL));
...
ATLENSURE_SUCCEEDED(pDirectSound8-&gt;SetCooperativeLevel(Window, DSSCL_PRIORITY));
...
ATLENSURE_SUCCEEDED(pDirectSound8-&gt;CreateSoundBuffer(&amp;BufferDescriptor, &amp;pDirectSoundBuffer, NULL));
...
CComQIPtr&lt;IDirectSoundNotify8, &amp;IID_IDirectSoundNotify8&gt; pDirectSoundNotify8 = pDirectSoundBuffer;
...
ATLENSURE_SUCCEEDED(pDirectSoundNotify8-&gt;SetNotificationPositions(g_nPositionCount, pPositionNotify));
ATLENSURE_SUCCEEDED(pDirectSoundBuffer-&gt;Play(0, 0, DSBPLAY_LOOPING));</pre>
<p><span id="more-682"></span></p>
<p>Application output:</p>
<pre>BufferDescriptor.dwBufferBytes 128000
g_nPositionCount 8
pPositionNotify[0].dwOffset 15999
pPositionNotify[1].dwOffset 31999
pPositionNotify[2].dwOffset 47999
pPositionNotify[3].dwOffset 63999
pPositionNotify[4].dwOffset 79999
pPositionNotify[5].dwOffset 95999
pPositionNotify[6].dwOffset 111999
pPositionNotify[7].dwOffset 127999
nWaitResult 0
nWaitResult 1
nWaitResult 2
nWaitResult 3
nWaitResult 4
nWaitResult 5
nWaitResult 6
nWaitResult 7
nWaitResult 0
nWaitResult 1
nWaitResult 2
nWaitResult 3
nWaitResult 4
nWaitResult 5
nWaitResult 6
nWaitResult 7</pre>
<p>A Visual C++ .NET 2008 source code <a href="http://trac2.assembla.com/roatl-utilities/browser/trunk/DirectSoundNotifySample01">is available from SVN</a>.</p>
<p>See Also:</p>
<ul>
<li><a href="http://msdn.microsoft.com/en-us/library/bb219693(VS.85).aspx">DirectSoundCreate8</a></li>
<li><a href="http://msdn.microsoft.com/en-us/library/bb174483(VS.85).aspx">IDirectSoundNotify8</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://alax.info/blog/682/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

