Author Topic: .OGA to .WAV  (Read 428 times)

.OGA to .WAV
« on: 1 May '19 - 17:05 »
Hello,

Is it possible to read a .OGA file and convert to .WAV using BASS?
I seem to be struggling reading the file.

Ian @ un4seen

  • Administrator
  • Posts: 21861
Re: .OGA to .WAV
« Reply #1 on: 1 May '19 - 17:48 »
OGA files are OGG files, usually containing FLAC data. So if you aren't already using the BASSFLAC add-on (eg. via BASS_PluginLoad), you could give that a try.

https://wiki.xiph.org/index.php/MIME_Types_and_File_Extensions

Regarding conversion to WAV, you can use the BASSenc add-on for that, eg. BASS_Encode_Start with BASS_ENCODE_PCM. Please see the BASS_Encode_Start documentation for details.

Re: .OGA to .WAV
« Reply #2 on: 1 May '19 - 18:35 »
Hi Ian,

Thanks for that. Just tried to do this but still can't open the file. This file was recorded by WebAPI in Chrome.

Code: [Select]
https://www.dropbox.com/s/ww734rpci4nhkwn/test2.oga?dl=1
Would you mind seeing if you can read it?

sveakul

  • Posts: 80
Re: .OGA to .WAV
« Reply #3 on: 1 May '19 - 19:28 »
For what it's worth, MediaInfo shows this as a 32-bit depth 48kHz Opus file in a WebM(.v4) container.  Renaming it with *.webm made it play fine in Foobar but not others (XMPlay, AIMP).

Re: .OGA to .WAV
« Reply #4 on: 1 May '19 - 20:30 »
Thank you sveakul, anything in the Bass suite that could read this?

Ian @ un4seen

  • Administrator
  • Posts: 21861
Re: .OGA to .WAV
« Reply #5 on: 2 May '19 - 12:35 »
That file is indeed a WEBM file rather than an OGG/OGA file. There is a BASSWEBM add-on that hasn't been officially released yet. It's available here:

   www.un4seen.com/stuff/basswebm.zip

You will also need the BASSOPUS add-on to play that file, ie. load both via BASS_PluginLoad.

Code: [Select]
BASS_PluginLoad("basswebm.dll", 0);
BASS_PluginLoad("bassopus.dll", 0);

Steve Grant

  • Posts: 177
Re: .OGA to .WAV
« Reply #6 on: 2 May '19 - 14:17 »
Hi Ian, I tried yesterday with the Test2 file and VLC played it ok but obviously Bass wouldn't.

I've downloaded the BassWebm.dll and this loads along with BassOpus just fine but It still won't create a valid stream.

Code: [Select]
'Get Plug In's
        D$ = Dir("bass*.dll")                                               'find 1st file

        Do While (D$ <> "")
            Debug.Print D$, BASS_PluginLoad(D$, 0)                                           'plugin loaded...
            D$ = Dir()                                                      'get next file
        Loop

Opus returns 4. Webm 5.

Ian @ un4seen

  • Administrator
  • Posts: 21861
Re: .OGA to .WAV
« Reply #7 on: 2 May '19 - 15:10 »
That's strange, it is playing here, although not looping because it doesn't contain any duration info. Here's an update that adds support for looping and seeking when the duration is unavailable:

   www.un4seen.com/stuff/basswebm.zip

If it still isn't working for you, please try with the pre-compiled PLUGINS.EXE example from the BASS package (C\BIN folder).

Re: .OGA to .WAV
« Reply #8 on: 2 May '19 - 17:19 »
Thank you everyone for your help. Much appreciated.

Steve Grant

  • Posts: 177
Re: .OGA to .WAV
« Reply #9 on: 2 May '19 - 21:44 »
OK it does play here with both versions. It was the lack of Duration that was causing my program to branch to the error trap.

Once I remarked all of that out it loaded with a bitrate of 105kbps and a running time of 6hrs : 12mins : 50 secs even though it ran for just 4.5 secs.

As always, many thanks.

sveakul

  • Posts: 80
Re: .OGA to .WAV
« Reply #10 on: 4 May '19 - 01:51 »
Here's an update that adds support for looping and seeking when the duration is unavailable:

   www.un4seen.com/stuff/basswebm.zip

If it still isn't working for you, please try with the pre-compiled PLUGINS.EXE example from the BASS package (C\BIN folder).

Thanks Ian for access to this new plugin;  any idea as to when you will do an official release of it on the add-ons page?

Ian @ un4seen

  • Administrator
  • Posts: 21861
Re: .OGA to .WAV
« Reply #11 on: 7 May '19 - 17:59 »
Nothing definite at the moment. The original plan was to possibly first expand it to support some more Matroska features, mainly more audio codecs. WebM is a subset of Matroska that only supports Vorbis and Opus codecs, while full Matroska supports more codecs (list here). So some Matroska files will already be supported but not all.