Author Topic: BASS_ERROR_FILEFORM with Chrome generated WebM / Opus (.net)  (Read 578 times)

davecarter

  • Posts: 14
Hoping someone can help me.

I seem to be running into an issue with the BASS_OPUS_StreamCreateFile() method using BASS.net.

I'm loading the plugin using Bass.BASS_PluginLoad("bassopus.dll") which is loading okay (returns 1, and BASS_ErrorGetCode() is BASS_OK.

Then I'm simply running
Code: [Select]
var streamPtr = BassOpus.BASS_OPUS_StreamCreateFile("c:\\users\\davey\\downloads\\audio.opus", 0l, 0l, BASSFlag.BASS_STREAM_DECODE);

I receive the error BASS_ERROR_FILEFORM.

I tried with an opus sample file downloaded from a website, and this seems to open fine. So I'm trying to get to the bottom of what's actually occurring.

The original file "audio.opus" was recorded using WebRTC as I'm trying to record clips through my browser, convert them to MP3 and store them in another folder. Now, I've loaded both files into MediaInfo, and looked at the information of the file (screenshots below)

I'd tried previously with using the WebM addon, but received "BASS_ERROR_CODEC", when I looked at the headers of the file I saw it was technically Opus, so I figured it was worth a shot trying to open the file using BassOpus.

Any pointers would be hugely helpful, please feel free to let me know I've missed something blindingly obvious. ::)



« Last Edit: 4 Oct '23 - 23:25 by davecarter »

Ian @ un4seen

  • Administrator
  • Posts: 26222
Loading both BASSOPUS and BASSWEBM via BASS_PluginLoad should allow you to play WebM files that contain Opus data. If your file still isn't playable even then, please upload (or link) it to have a look at here:

   ftp.un4seen.com/incoming/

davecarter

  • Posts: 14
Loading both BASSOPUS and BASSWEBM via BASS_PluginLoad should allow you to play WebM files that contain Opus data.

I can't believe I missed that, it really was that simple. Although I'd added the BassOpus, and BassWebm dll's to the solution, I was only ever loading the one I wanted to use. In my case, when trying to use StreamCreateFile from the WebM addon, I was only loading the webm dll.. Same deal when I was trying opus.

So to confirm for anyone else that comes across this, in order to read a webm file recorded by RecordRTC/WebRTC in Chrome, I needed to load both BassWebm and BassOpus plugins, and then use StreamCreateFile for the container format (i.e. using the BassWebm.BASS_WEBM_StreamCreateFile()) method to read the audio.

Thank you Ian!

Chris

  • Posts: 2221
Hi if you have load the BassOpus, BassWebM via Bass_PluginLoad... 
then can you create the stream via Bass_StreamCreateFile. (Bass will automatically  handle the Plugins StreamCreateFile Calls internal ) (For That is the PluginSystem of Bass).

davecarter

  • Posts: 14
Hi if you have load the BassOpus, BassWebM via Bass_PluginLoad... 
then can you create the stream via Bass_StreamCreateFile. (Bass will automatically  handle the Plugins StreamCreateFile Calls internal ) (For That is the PluginSystem of Bass).

Oh that's great! Excellent news, that's going to make my process much cleaner to manage.

Thanks to you too Chris!