Author Topic: I Want Data(Piece, split ) Control~!  (Read 1021 times)

radiomike

  • Posts: 14
I Want Data(Piece, split ) Control~!
« on: 27 Aug '10 - 06:24 »
Sorry I keep asking,  
To edit a wave file, I then made the following code
Code: [Select]
CFile  file;
BYTE * pBuffer = NULL;

pBuffer = new BYTE[(44100*2*2*50)]; //50sec Buf

file.Open(_T("Mp3out3.pcm"), CFile::modeRead, NULL);

file.Seek(44100*2*2*60, CFile::current); //

file.Read(pBuffer, (44100*2*2*50));      ////50sec Buf

file.Close();

CFile writeFile;

writeFile.Open(_T("D:\\VC_TEST\\WaveCut\\50sec.pcm"), CFile::modeCreate|CFile::modeWrite, NULL);
writeFile.Write(pBuffer, (44100*2*2*50));    //50sec Buf
writeFile.Close();

delete pBuffer;



As you can see,

50 seconds of sound files of code that is a cut of the data.

But the problem here is.

It read 10 seconds rather than the size of the data, large lot, if you clear the code, the problem will be in to work.  

So tough is the low-level API Wave Control.

If you do not have the buffer set to large.

BASS engine the way you control low-level API similar to the waves I wonder how.

Shall be supported by clear expectations is a great BASS. ^ ^

Forum Search Results tried BASS_StreamCreateFileUser () function, which I do not know what I'm driving you've been.

The second question!!!!

Information on the status of the sound file and the pcm data were obtained.

Pure pcm data in memory I do not know what to do to play.

It is pure I got pcm.

I am a programmer in Korea is the last.

English is very poor so I use the Google translator conveys.

Translator from English to understand it or not because I will really appreciate if you help.

The city always give clear answers [Ian @ un4seen] to thank.

Taussig does NOT regret lately been studying English and learning English are being own.

« Last Edit: 27 Aug '10 - 06:55 by radiomike »

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: I Want Data(Piece, split ) Control~!
« Reply #1 on: 27 Aug '10 - 15:23 »
Regarding playing PCM sample data, you can use BASS_StreamCreate (and a STREAMPROC callback) to do that, eg. create a stream with the appropriate sample format (in the BASS_StreamCreate parameters) and then feed the sample data into the STREAMPROC. Please see the documentation for details.

radiomike

  • Posts: 14
Re: I Want Data(Piece, split ) Control~!
« Reply #2 on: 31 Aug '10 - 05:39 »
Your Reply So Thanks~!

This My Sample Code~!

Please Help Me~!

Code: [Select]
DWORD (CALLBACK MYSTREAMPROC)(HSTREAM handle, void *buffer, DWORD length, void *user)
{
TRACE("CAllBack Come IN..\n");
return TRUE;
}

void CWaveCutDlg::OnButtoncallback()
{

if (!BASS_Init(-1,44100,0,0,NULL))
{
return;
}

HSTREAM chan;
// create a "push" stream
chan = BASS_StreamCreate(44100, 2, 0, MYSTREAMPROC,0);

CFile  file;
BYTE * pBuffer = NULL;

pBuffer = new BYTE[(44100*2*2*7)]; //50sec Buf

file.Open(_T("Mp3out3.pcm"), CFile::modeRead, NULL);

file.Seek(44100*2*2*60, CFile::current); //

file.Read(pBuffer, (44100*2*2*7));      ////50sec Buf

file.Close();


BASS_StreamPutData(chan, pBuffer, 44100*2*2*7);
BASS_ChannelPlay(chan,TRUE); // play clone



}

Ian @ un4seen

  • Administrator
  • Posts: 20437
Re: I Want Data(Piece, split ) Control~!
« Reply #3 on: 31 Aug '10 - 13:37 »
If you want to use BASS_StreamPutData, you need to use STREAMPROC_PUSH (instead of "MYSTREAMPROC") in the BASS_StreamCreate call. Please see the documentation for details.