23 May '13 - 11:13 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: BASS.NET - Can I use BaseEncoder.EncodeFile() to decode a FLAC file?  (Read 1660 times)
ghova
Posts: 3


« on: 21 Aug '08 - 18:28 »
Reply with quoteQuote

Hi everyone,

I'm a relatively green C# guy; I spent most of my career on the sound side of things. 

I need to programatically encode many files from WAV to FLAC, and then decode them back from FLAC to WAV.

I worked out how to use BaseEncoder.EncodeFile with an EncoderFLAC instance to handle the encode.  No problem there.  But I'm running into problems finding an easy way to decode the FLAC file back into WAV.  Unless I'm missing something blindingly obvious (entirely possible), BaseEncoder.EncodeFile doesn't seem to support decoding the file from FLAC to WAV.

I've tried adding a "-d" flag to the FLAC_CustomOptions field, and I've tried turning FLAC_UseCustomOptionsOnly on.  Neither seems to do the trick.

Should I be calling EncoderFLAC.Start() and feeding the stream into a WaveWriter?  That's a bit more of a pain for me because I'm not terribly experienced, so I'd like to take the quicker, less error-prone way if possible.  Smiley

Thanks!
Logged
radio42
Posts: 4012


« Reply #1 on: 21 Aug '08 - 21:56 »
Reply with quoteQuote

hhmm the EncoderWAV should actually work.
But you probably haven't loaded the Flac add-on via BASS_PluginLoad.
The EncodeFile method uses BASS_StreamCreateFile internally, so unless you have loaded the flac add-on the flac format wouldn't be supported.
So simply call BASS_PluginLoad("bassflac.dll") in advance.
Logged
ghova
Posts: 3


« Reply #2 on: 21 Aug '08 - 21:59 »
Reply with quoteQuote

hhmm the EncoderWAV should actually work.
But you probably haven't loaded the Flac add-on via BASS_PluginLoad.
The EncodeFile method uses BASS_StreamCreateFile internally, so unless you have loaded the flac add-on the flac format wouldn't be supported.
So simply call BASS_PluginLoad("bassflac.dll") in advance.

Thanks for the reply!  I think I tried this once, but I don't believe I called BASS_PluginLoad.  I'll give that a whirl.

Stupid question alert: What's the difference between BASS_PluginLoad("bassflac.dll") and BassFlac.LoadMe()?
Logged
radio42
Posts: 4012


« Reply #3 on: 21 Aug '08 - 22:22 »
Reply with quoteQuote

The .LoadMe methods are normally never needed as they simply load the dll into memory - which is anyhow performed when the first library method is called. But some rare scenarios require the dll to be loaded first.
But .LoadMe doesn't load the dll as an add-on.

PluginLoad does both: load the dll and as an add-on - so when ever possible use this one :-)

Logged
ghova
Posts: 3


« Reply #4 on: 21 Aug '08 - 22:25 »
Reply with quoteQuote

The .LoadMe methods are normally never needed as they simply load the dll into memory - which is anyhow performed when the first library method is called. But some rare scenarios require the dll to be loaded first.
But .LoadMe doesn't load the dll as an add-on.

PluginLoad does both: load the dll and as an add-on - so when ever possible use this one :-)



You're kidding!  I thought LoadMe, and therefore FreeMe, were absolutely necessary.

Well, that makes things a little easier... Grin
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines