diff --git a/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp b/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp index dbf20f8b85..41b37b3bcd 100644 --- a/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp +++ b/modules/juce_audio_formats/codecs/juce_WindowsMediaAudioFormat.cpp @@ -38,7 +38,7 @@ public: } JUCE_COMRESULT Commit (DWORD) { return S_OK; } - JUCE_COMRESULT Write (void const*, ULONG, ULONG*) { return E_NOTIMPL; } + JUCE_COMRESULT Write (const void*, ULONG, ULONG*) { return E_NOTIMPL; } JUCE_COMRESULT Clone (IStream**) { return E_NOTIMPL; } JUCE_COMRESULT SetSize (ULARGE_INTEGER) { return E_NOTIMPL; } JUCE_COMRESULT Revert() { return E_NOTIMPL; } @@ -145,10 +145,16 @@ public: { HRESULT hr = wmCreateSyncReader (nullptr, WMT_RIGHT_PLAYBACK, wmSyncReader.resetAndGetPointerAddress()); hr = wmSyncReader->OpenStream (new JuceIStream (*input)); - hr = wmSyncReader->SetReadStreamSamples (0, false); - scanFileForDetails(); - ok = sampleRate > 0; + if (SUCCEEDED (hr)) + { + WORD streamNum = 1; + hr = wmSyncReader->GetStreamNumberForOutput (0, &streamNum); + hr = wmSyncReader->SetReadStreamSamples (streamNum, false); + + scanFileForDetails(); + ok = sampleRate > 0; + } } } diff --git a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp index cc734647b4..727f75e89a 100644 --- a/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp +++ b/modules/juce_audio_formats/format/juce_AudioFormatManager.cpp @@ -23,7 +23,7 @@ ============================================================================== */ -//============================================================================== + AudioFormatManager::AudioFormatManager() : defaultFormatIndex (0) { @@ -62,10 +62,6 @@ void AudioFormatManager::registerBasicFormats() registerFormat (new WavAudioFormat(), true); registerFormat (new AiffAudioFormat(), false); - #if JUCE_MAC || JUCE_IOS - registerFormat (new CoreAudioFormat(), false); - #endif - #if JUCE_USE_FLAC registerFormat (new FlacAudioFormat(), false); #endif @@ -74,7 +70,13 @@ void AudioFormatManager::registerBasicFormats() registerFormat (new OggVorbisAudioFormat(), false); #endif - #if JUCE_USE_MP3AUDIOFORMAT + #if JUCE_MAC || JUCE_IOS + registerFormat (new CoreAudioFormat(), false); + #elif JUCE_WINDOWS + registerFormat (new WindowsMediaAudioFormat(), false); + #elif JUCE_USE_MP3AUDIOFORMAT + // The software MP3 decoder is only used as a default format if + // there isn't an OS-provided alternative. registerFormat (new MP3AudioFormat(), false); #endif }