Author Topic: For Dark Basic  (Read 5448 times)

3D

  • Posts: 12
For Dark Basic
« on: 18 Apr '09 - 04:24 »
???????
how use - CALL DLL 1,"BASS_ChannelSetPosition", HD, 100000 ,0 
???????

PLEASE !!!!!!!!


PLEASE Give in what order and which commands should I use to just MP3 OPEN B AND SOME OF ITS Play Rewind Forward - Back

   I can not understand WHY DO NOT INSTALL POSITION
« Last Edit: 21 Apr '09 - 19:32 by 3D »

(: JOBnik! :)

  • Posts: 1065
Re: For Dark Basic
« Reply #1 on: 20 Apr '09 - 10:16 »
Hi ;D

I don't know how to write in DarkBasic, but here are some examples of how to do it with C/C++, I'm sure it will be easy for you to translate it to your language:

To load a sound file:

DWORD chan = BASS_StreamCreateFile(FALSE, "file.mp3", 0, 0, 0);


To Play it:

BASS_ChannelPlay(chan, FALSE);


Change position of played file to 33.5 seconds:

float newPos = 33.5; // seconds
BASS_ChannelSetPosition(chan, BASS_ChannelSeconds2Bytes(chan, newPos), BASS_POS_BYTE);


To get current position in seconds:

float curPos = BASS_ChannelBytes2Seconds(chan, BASS_ChannelGetPosition(chan, BASS_POS_BYTE));
« Last Edit: 20 Apr '09 - 10:19 by (: JOBnik! :) »

3D

  • Posts: 12
Re: For Dark Basic
« Reply #2 on: 21 Apr '09 - 18:49 »
 ;D  thanks (: JOBnik! :), but still does not change position.
I can set the volume, apply effects to change the position but can not (an error code 20 -not available). please tell if I will re-open the file with a new position this is a bad thing? (So is)
« Last Edit: 21 Apr '09 - 18:57 by 3D »

3D

  • Posts: 12
Re: For Dark Basic
« Reply #3 on: 21 Apr '09 - 19:20 »
Prompt please how to solve the flow frequency. how to obtain them, I realized that using GetChenelData I get the volume level of the signal - right?
but how do you know where the low and high frequencies where?
that have to do?

radio42

  • Posts: 4576
Re: For Dark Basic
« Reply #4 on: 22 Apr '09 - 09:11 »
Read the docs? ;-)

You can also use BASS_ChannelGetData to obtain the FFT data.
Code: [Select]
float fft[512]; // fft data buffer
BASS_ChannelGetData(channel, fft, BASS_DATA_FFT1024);

3D

  • Posts: 12
Re: For Dark Basic
« Reply #5 on: 22 Apr '09 - 15:07 »
I read Doc. What is FFT? there is not written.
I do not know English. translate online translator.
to explain the human language -not technical.

radio42

  • Posts: 4576
Re: For Dark Basic
« Reply #6 on: 22 Apr '09 - 15:22 »
FFT is actual very technical but typical in audio processing - see: http://en.wikipedia.org/wiki/FFT
May be you can find a web-site explaining it in your language.

So the FFT analyses gives you the energy per defined frequency bands, e.g. an BASS_DATA_FFT1024 analyses results in an float array with 512 elements.
Each element represents the energy value of a certain frequency (see Nynquist - yes, this is audio theory again, but it helps you to understand ;-).
The index of the element in the array can be calculates as followed:

Example: If the stream is 44100Hz, then 16500Hz will be around bin 383 of a 1024 sample FFT (1024*16500/44100).

So if you are looking for frequencies within the raw PCM sample data you need to perform an FFT analyses, as the raw PCM sample data just doesn't contain it straight away.
The raw PCM data just describe the wave curve over time...

3D

  • Posts: 12
Re: For Dark Basic
« Reply #7 on: 22 Apr '09 - 16:21 »
Thank you very much radio42.
Describe everything as I understand.
1024 * (80 \ 44100) = 1.857 rounded to 2 and 2 in the array will power the alarm 80Hrz. so?

radio42

  • Posts: 4576
Re: For Dark Basic
« Reply #8 on: 22 Apr '09 - 17:17 »
Correct.
Assuming you are using the BASS_DATA_FFT1024 flag and having a stream with a samplerate of 44100.

3D

  • Posts: 12
Re: For Dark Basic
« Reply #9 on: 22 Apr '09 - 18:00 »
Thank you very much for the explanation and for the link.
but divided into channels (left / right)

radio42

  • Posts: 4576
Re: For Dark Basic
« Reply #10 on: 22 Apr '09 - 19:28 »
Please see the docs...

3D

  • Posts: 12
Re: For Dark Basic
« Reply #11 on: 22 Apr '09 - 20:38 »
I apologize for that might annoy stupid questions.
I just recently burned down the house and the computer, I get rare but accurately.
but this time I go to the forum from my phone.
and I want to make time when I will be at the PC to be able to to do something specific.
before the fire, I wrote the 3D Editor and the time has come for the sound.
if you want it to look it here:
http://3d-pro.livejournal.com/
I plan to turn it into a 3D browser.

3D

  • Posts: 12
Re: For Dark Basic
« Reply #12 on: 9 Jun '09 - 11:10 »
a
« Last Edit: 9 Jun '09 - 11:16 by 3D »

3D

  • Posts: 12
Re: For Dark Basic
« Reply #13 on: 9 Jun '09 - 11:27 »
b

3D

  • Posts: 12
Re: For Dark Basic
« Reply #14 on: 9 Jun '09 - 19:35 »
c

radio42

  • Posts: 4576
Re: For Dark Basic
« Reply #15 on: 9 Jun '09 - 20:27 »
Hey 3D,

what is the question here?
Or the reason for your constant pings...a, b, c ... ?

3D

  • Posts: 12
Re: For Dark Basic
« Reply #16 on: 15 Jun '09 - 18:31 »
HOW TO REMOVE Give POST.
Someone Raven with my PC

JM-DG

  • Posts: 112
Re: For Dark Basic
« Reply #17 on: 15 Jun '09 - 19:44 »
 ;D Maybe ian can remove  ::)