Permalink
Browse files

work with FMLE again LOL

  • Loading branch information...
1 parent 14da056 commit 8ff9f6542a52a85327f69ab93a23d25e5a47e306 @rdp committed Oct 18, 2012
View
@@ -1,6 +1,10 @@
+0.3.13
+
+ work with FMLE again <sigh>
+
0.3.11
-actually work with ffmpeg
+actually work with ffmpeg (scripts)
0.3.10
View
2 TODO
@@ -12,6 +12,8 @@
== meh/never ==
+2 pins, one with 32 bit audio :)
+
some thing that shows the current "bars" of how much it could/would be capturing...
figure out/debug pauses in FME when clicking "stop"...huh?
View
@@ -1,4 +1,4 @@
-#define AppVer "0.3.11"
+#define AppVer "0.3.12"
#define AppName "Virtual Audio Capture Grabber"
Binary file not shown.
@@ -3,7 +3,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommand>C:\installs\ffmpeg-20120903-git-5d55830-win32-static\ffmpeg-20120903-git-5d55830-win32-static\bin\ffmpeg.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
- <LocalDebuggerCommandArguments> -f dshow -i audio=virtual-audio-capturer -y yo.mp3</LocalDebuggerCommandArguments>
+ <LocalDebuggerCommandArguments> -threads 0 -y -f dshow -i audio=virtual-audio-capturer -y yo.wav</LocalDebuggerCommandArguments>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LocalDebuggerCommand>C:\Program Files (x86)\VideoLAN\VLC\vlc.exe</LocalDebuggerCommand>
@@ -167,7 +167,7 @@ HRESULT setupPwfex(WAVEFORMATEX *pwfex, AM_MEDIA_TYPE *pmt) {
pwfex->cbSize = 0; // apparently should be zero if using WAVE_FORMAT_PCM http://msdn.microsoft.com/en-us/library/ff538799(VS.85).aspx
pwfex->nChannels = getChannels(); // 1 for mono, 2 for stereo..
pwfex->nSamplesPerSec = getHtzRate();
- pwfex->wBitsPerSample = getBitsPerSample(); // 16 bit sound
+ pwfex->wBitsPerSample = 16; // 16 bit sound
pwfex->nBlockAlign = (WORD)((pwfex->wBitsPerSample * pwfex->nChannels) / BITS_PER_BYTE);
pwfex->nAvgBytesPerSec = pwfex->nSamplesPerSec * pwfex->nBlockAlign; // it can't calculate this itself? huh?
@@ -238,29 +238,7 @@ HRESULT CVCamStream::DecideBufferSize(IMemAllocator *pAlloc,
WAVEFORMATEX *pwfexCurrent = (WAVEFORMATEX*)m_mt.Format();
-
- /*int nBitsPerSample = pwfexCurrent->wBitsPerSample;
- int nSamplesPerSec = pwfexCurrent->nSamplesPerSec;
- int nChannels = pwfexCurrent->nChannels;
-
- pProperties->cbBuffer = WaveBufferChunkSize;
-
- pProperties->cBuffers = (nChannels * nSamplesPerSec * nBitsPerSample) /
- (pProperties->cbBuffer * BITS_PER_BYTE);
-
- // Get 1/?? second worth of buffers, rounded to WaveBufferSize
-
- pProperties->cBuffers /= SECOND_FRACTIONS_TO_GRAB;
-
- // double check for underflow...
- if(pProperties->cBuffers < 1)
- pProperties->cBuffers = 1;
-
- long maxBufferSize = pProperties->cbBuffer * pProperties->cBuffers;
- expectedMaxBufferSize = maxBufferSize;
- */
-
- // just use our max size (or whatever they specified for us)
+ // just use our max size for the buffer size (or whatever they specified for us, if they did)
pProperties->cBuffers = 1;
pProperties->cbBuffer = expectedMaxBufferSize;
@@ -93,13 +93,13 @@ int getHtzRate() {
propagateWithRawCurrentFormat(&format);
return format.nSamplesPerSec;
}
-
+/*
int getBitsPerSample() {
WAVEFORMATEX format;
propagateWithRawCurrentFormat(&format);
return format.wBitsPerSample;
}
-
+*/
int getChannels() {
WAVEFORMATEX format;
propagateWithRawCurrentFormat(&format);
@@ -112,7 +112,7 @@ HRESULT LoopbackCaptureSetup()
assert(shouldStop); // duplicate starts would be odd...
shouldStop = false; // allow graphs to restart, if they so desire...
pnFrames = 0;
- bool bInt16 = true; // makes it actually work, for some reason...my guess is
+ bool bInt16 = true; // makes it actually work, for some reason...my guess is it's a more common format
HRESULT hr;
hr = get_default_device(&m_pMMDevice); // so it can re-place our pointer...
@@ -175,7 +175,9 @@ HRESULT LoopbackCaptureSetup()
// WE GET HERE!
pEx->SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
// convert it to PCM, but let it keep as many bits of precision as it has initially...though it always seems to be 32
- //pwfx->wBitsPerSample = 16;
+ // comment this out and set wBitsPerSample to pwfex->wBitsPerSample = getBitsPerSample(); to get an arguably "better" quality 32 bit pcm
+ // unfortunately flash media live encoder basically rejects 32 bit pcm, and it's not a huge gain sound quality-wise, so disabled for now.
+ pwfx->wBitsPerSample = 16;
pEx->Samples.wValidBitsPerSample = pwfx->wBitsPerSample;
pwfx->nBlockAlign = pwfx->nChannels * pwfx->wBitsPerSample / 8;
pwfx->nAvgBytesPerSec = pwfx->nBlockAlign * pwfx->nSamplesPerSec;

0 comments on commit 8ff9f65

Please sign in to comment.