21 May '13 - 11:56 *
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: how to join two file to a file?  (Read 2097 times)
simon1
Posts: 100


« on: 6 Jun '08 - 00:17 »
Reply with quoteQuote

IE,a file is mp3 another file is ogg
I want to join mp3 and ogg to a wave file,how?
I find mixer addon only can mix two file not join file!

before I can use filestream continue write,so no problem
but now use bassenc addon, I find can not do this job.
1:encode mp3 to wave(same HENCODE Return by BASS_Encode_Start)
2:not stop bassenc
3:encode ogg to wave
4:stop bassenc(same HENCODE Return by BASS_Encode_Start)
but result only have mp3 file to wave,another file not output to same wave file,how about?

Logged
BassFan
Guest
« Reply #1 on: 6 Jun '08 - 00:35 »
Reply with quoteQuote

no idea which language use
here a link to Vb
http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=70568&lngWId=1

greets BassFan
Logged
radio42
Posts: 4012


« Reply #2 on: 6 Jun '08 - 07:49 »
Reply with quoteQuote

Why couldn't you use the BASSmix add-on.
With BASSmix you should be able to simply join two streams into one.
You simply need to add the second one to the mixer once the first one ends.
This can either be done by a SYNCPROC or by using BASS_Mixer_StreamAddChannelEx.
Logged
simon1
Posts: 100


« Reply #3 on: 6 Jun '08 - 12:40 »
Reply with quoteQuote

in fact I not to want mix two files, maybe many files
so I think bassenc should do this job not use bassmix,
but bassenc seems not can keep handle to contiue write next files
Logged
radio42
Posts: 4012


« Reply #4 on: 6 Jun '08 - 13:17 »
Reply with quoteQuote

BASSenc can not mix multiple files. So I suggest you use BASSmix to mix/join multiple file and then use BASSenc on the mixer stream to encode the result...
Logged
simon1
Posts: 100


« Reply #5 on: 6 Jun '08 - 14:11 »
Reply with quoteQuote

how BASS_Mixer_StreamAddChannelEx work?

 for i := 0 to Count-1 do
 begin
 if i=0 then
 BASS_Mixer_StreamAddChannel(mixchan,sourcechan,BASS_STREAM_AUTOFREE) else
 begin
 PreBytes:=PreBytes+BASS_ChannelGetLength(sourcechan[i-1],BASS_POS_BYTE);
 BASS_Mixer_StreamAddChannelEx(MixChan,sourcechan,BASS_STREAM_AUTOFREE,PreBytes,0);
 end;
end;
wrong! result have silent,
IE,if first file have 4:00 then result wil get
first file+4:00 silent+second files
if use PreBytes=0 result same as BASS_Mixer_StreamAddChannel
how do?
Logged
Ian @ un4seen
Administrator
Posts: 15253


« Reply #6 on: 6 Jun '08 - 14:31 »
Reply with quoteQuote

If the sources all have the same sample format (eg. stereo 44100hz or whatever), then you can actually do this without BASSmix; you just need to use BASS_Encode_SetChannel at the end of each source to move the encoder to the next source.

If the sources have varying samples formats, then you should use BASSmix (and feed the mixer to BASSenc) so that they are resampled to a consistent format. Here's an example of using BASSmix for gapless playback (or encoding)...

   www.un4seen.com/forum/?topic=6159.msg41390#msg41390
Logged
big_gun
Posts: 342


« Reply #7 on: 6 Jun '08 - 15:25 »
Reply with quoteQuote

If you are doing it in .NET see the audio joiner sample. in the bassNet download. It does what you want.
Logged
simon1
Posts: 100


« Reply #8 on: 6 Jun '08 - 19:13 »
Reply with quoteQuote

to Ian
Thank you,now work
but there is a problem
if a file have large like 10 minutes
second file have 40 minutes
now i want to join it but part join
first large file I only want to join use 5 minutes
and second file I use 25 minutes
but I find there is a problem
BASS_Mixer_StreamAddChannelEx not work
for first file 0 to 5 minutes, but output file
5-10 minutes mix second file 25 minutes like
 (I want)
0--------5----------10 first file
             0-----------------25------------40 second file
                 (I want)
output file also 30 miniutes but for first file 5-10 minutes still into output file
BASS_Mixer_StreamAddChannelEx(mixchan,sourcechan[1],BASS_MIXER_NORAMPIN or BASS_STREAM_AUTOFREE,0,el);
el=5 minutes bytes
what's wrong?
Logged
simon1
Posts: 100


« Reply #9 on: 9 Jun '08 - 18:06 »
Reply with quoteQuote

Ian
Any Idea?
Logged
simon1
Posts: 100


« Reply #10 on: 9 Jun '08 - 23:43 »
Reply with quoteQuote

ok,I have a input wrong  on el=5 minutes bytes
BASS_Mixer_StreamAddChannelEx work fine
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines