Вверх ↑
Ответов: 2059
Рейтинг: 132
#1: 2017-10-18 13:10:46 ЛС | профиль | цитата
Качаешь в стрим, а из стрима делаешь звуковой поток.
Или так, вот я переделывал компоненты: http://forum.hiasm.com/getfile/38224
В BASS_SmpFile ставишь mem = TRUE, а вместо FileName подать адрес памяти.


BASS_SampleLoad

--------------------------------------------------------------------------------

Loads a WAV, AIFF, MP3, MP2, MP1, OGG or plugin supported sample.


HSAMPLE BASS_SampleLoad(
BOOL mem,
void *file,
QWORD offset,
DWORD length,
DWORD max,
DWORD flags
);
Parameters
mem TRUE = load the sample from memory.
file Filename (mem = FALSE) or a memory location (mem = TRUE).
offset File offset to load the sample from (only used if mem = FALSE).
length Data length... 0 = use all data up to the end of file (if mem = FALSE). If length over-runs the end of the file, it will automatically be lowered to the end of the file.
max Maximum number of simultaneous playbacks... 1 (min) - 65535 (max). Use one of the BASS_SAMPLE_OVER flags to choose the override decider, in the case of there being no free channel available for playback (ie. the sample is already playing max times).
flags A combination of these flags.
BASS_SAMPLE_FLOAT Use 32-bit floating-point sample data. Not really recommended for samples as it (at least) doubles the memory usage.
BASS_SAMPLE_LOOP Looped? Note that only complete sample loops are allowed, you cannot loop just a part of the sample. More fancy looping can be achieved by streaming the file.
BASS_SAMPLE_MONO Convert the sample (MP3/MP2/MP1 only) to mono, if it is not already. This flag is automatically applied if BASS_DEVICE_MONO was specified when calling BASS_Init.
BASS_SAMPLE_SOFTWARE Force the sample to not use hardware mixing.
BASS_SAMPLE_VAM Enables the DX7 voice allocation and management features on the sample, which allows the sample to be played in software or hardware. This flag is ignored if the BASS_SAMPLE_SOFTWARE flag is also specified.
BASS_SAMPLE_3D Enable 3D functionality. This requires that the BASS_DEVICE_3D flag was specified when calling BASS_Init, and the sample must be mono.
BASS_SAMPLE_MUTEMAX Mute the sample when it is at (or beyond) its max distance (software-mixed 3D samples only).
BASS_SAMPLE_OVER_VOL Override: the channel with the lowest volume is overridden.
BASS_SAMPLE_OVER_POS Override: the longest playing channel is overridden.
BASS_SAMPLE_OVER_DIST Override: the channel furthest away (from the listener) is overridden (3D samples only).
BASS_UNICODE file is in UTF-16 form. Otherwise it is ANSI on Windows or Windows CE, and UTF-8 on other platforms.

Return value
If successful, the loaded sample's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.

качаешь в стрим, а из стрима делаешь звуковой поток.
карма: 6

0
Редактировалось 2 раз(а), последний 2017-10-18 13:22:42