20 Jun '13 - 12:54 *
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: recording output to file + bassenc  (Read 492 times)
dennis_margelys
Posts: 66


« on: 18 Mar '12 - 23:02 »
Reply with quoteQuote

hi, everyone....

ok, i have a playlist and im using bassmix and bassenc, and im doing the following to record to file.....

BASS_Mixer_ChannelRemove(stream);
    if(g_==0)
        mix=BASS_Mixer_StreamCreate(44100, 1, BASS_SPEAKER_N(f_)|BASS_SPEAKER_LEFT);
    else
        mix=BASS_Mixer_StreamCreate(44100, 1, BASS_SPEAKER_N(f_)|BASS_SPEAKER_RIGHT);
    stream=BASS_StreamCreateFile(FALSE,filepath.toLatin1().data(),0,0,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    stream=BASS_FX_TempoCreate(stream,BASS_SAMPLE_FLOAT|BASS_STREAM_DECODE);
    set_handler(stream);   
    BASS_Mixer_StreamAddChannel(mix,temp,0);
    encoder = BASS_Encode_Start(mix, "lame --alt-preset standard - /home/alex/Escritorio/canal.mp3", BASS_ENCODE_LIMIT, NULL, 0);
    BASS_ChannelPlay(encoder,0);
    BASS_ChannelPlay(mix,FALSE);
    temp_title = filepath.split("/").last();
    media_path = filepath;   
    BASS_Encode_SetChannel(encoder,mix);

but everytime the playlist jumps to the next song bassenc overwrites the file and i want it to keep recording.... how can i achieve this with bassenc?Huh

Logged
Ian @ un4seen
Administrator
Posts: 15367


« Reply #1 on: 19 Mar '12 - 15:15 »
Reply with quoteQuote

To continue feeding an encoder with a different source, you can use BASS_Encode_SetChannel to move the encoder to the new source (don't call BASS_Encode_Start again). If you're feeding the encoder with a mixer (as it appears), then you could continue using the same mixer and just remove the old source from it (BASS_Mixer_ChannelRemove) and add the new one (BASS_Mixer_StreamAddChannel).
Logged
dennis_margelys
Posts: 66


« Reply #2 on: 19 Mar '12 - 15:53 »
Reply with quoteQuote

ok, i'll will give it a try.... now another problem is sync, the encoder has a big delay and when i make a change on the mixer the encoder takes some time to sync.... how can i keep it updating according to the mixer....
Logged
Ian @ un4seen
Administrator
Posts: 15367


« Reply #3 on: 19 Mar '12 - 17:51 »
Reply with quoteQuote

Do you mean there is a delay before you hear changes from the mixer, eg. when changing the source's attributes via BASS_ChannelSetAttribute? If so, that will be due to the mixer's playback buffer, ie. there is buffered data that needs to be played before the new data with your changes. You can reduce the size of the buffer via the BASS_CONFIG_BUFFER option (also see BASS_CONFIG_UPDATEPERIOD).
Logged
dennis_margelys
Posts: 66


« Reply #4 on: 20 Mar '12 - 13:18 »
Reply with quoteQuote

by the way, i can stream using cast to shoutcast or icecast, now, can i do this via UDP.... i mean.....

send somethig like this......udp://localhost:1234/channel1.mp3, the problem is that i have a setup box and i wanna do it using UDP.......
Logged
Ian @ un4seen
Administrator
Posts: 15367


« Reply #5 on: 20 Mar '12 - 14:44 »
Reply with quoteQuote

It isn't possible to send data to Shoutcast/Icecast servers via UDP. Is there a particular reason that you want to use UDP? If so, you could implement your own streaming system by using an ENCODEPROC function to receive the data from the encoder and then send that via UDP to the client, which can use BASS_StreamCreateFileUser to decode/play the data.

If you just want a custom streaming system (without a Shoutcast/Icecast server) and don't especially need UDP, you could have a look at BASS_Encode_ServerInit.
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines