Author Topic: Meta data in audio file created by BASS_Encode_FLAC_StartFile  (Read 455 times)

pzs7602

  • Posts: 80
I am trying to rip an flac file from CD using BASS_Encode_FLAC_StartFile:
Code: [Select]
// use default option
int code = BassEnc_Flac.BASS_Encode_FLAC_StartFile(stream, null, BASSEncode.BASS_ENCODE_FP_AUTO, AudioFileName);

the output flac file plays ok with audio player. But I check the file's meta data with easytag(or some player) and found the Bitrate and Duration are all 0. I also try the option "-0 --bps=768" with BASS_Encode_FLAC_StartFile, the result is the same.
Am I missing something?

Ubuntu 20.04
dotnet core 6.0
Bass.Net 2.4.17


Ian @ un4seen

  • Administrator
  • Posts: 25054
Check that you are calling BASS_Encode_Stop to end the encoding before exiting the app, as that will update the output FLAC file's header.

You may also want to use the "--until" option to tell BASS_Encode_FLAC_StartFile how long the encoding will be in advance (eg. "--until=-0" for the entire source), which will allow a seektable to be included in the file. BASS_Encode_FLAC_StartFile can't otherwise be sure how long the encoding will be, eg. it doesn't know if you will be encoding the entire source or just a part of it (or even moving the encoder to another source afterwards).

pzs7602

  • Posts: 80
Add BASS_Encode_Stop makes the output file normal, thanks!
BTW: I'm now using BASS_CD_StreamCreate in a loop for all audio tracks in CD to rip all tracks to different flac files, Is it possible to rip whole CD to one flac file? BASS_CD_StreamCreate has a track parameter so I have to handle every track in a loop and generate corresponding flac. Now I want to rip the whole CD into one flac file, how to do this?
 

Ian @ un4seen

  • Administrator
  • Posts: 25054
You can rip a whole CD to a single file by moving to the CD stream on to the next track at the end of each track, using BASS_CD_StreamSetTrack.

pzs7602

  • Posts: 80
Thanks! I'll have a try.