TBASS_StreamCreateFile

<< Click to Display Table of Contents >>

Navigation:  ThinBASIC Modules > TBASS (Sound Module) > Streams >

TBASS_StreamCreateFile

 

Description

 

Creates a sample stream from an MP3, MP2, MP1, OGG, WAV, AIFF or plugin supported file.

 

Syntax

 

hStream = TBASS_StreamCreateFile (Memory, FileName, Offset, Lenght, Flags)

 

Returns

 

Number

If successful, the new stream's handle is returned, else 0 is returned. Use %TBASS_ErrorGetCode to get the error code.

 

Parameters

 

Name

Type

Optional

Meaning

Memory

Number

No

%TBASS_TRUE = stream the file from memory.

FileName

String/Number

No

Filename (Memory = %TBASS_FALSE) or a memory location (Memory = %TBASS_TRUE).

Offset

Number

No

File offset to begin streaming from (only used if Memory = %TBASS_FALSE).

Lenght

Number

No

Data length... 0 = use all data up to the end of the file (if Memory = %TBASS_FALSE).

Flags

Number

No

Any combination of these flags.

 

Flag

Meaning

%TBASS_SAMPLE_FLOAT

Use 32-bit floating-point sample data. Not really recommended for samples as it (at least) doubles the memory usage.

 

%TBASS_SAMPLE_MONO

Convert the sample to mono, if it is not already mono. This flag is automatically applied if %TBASS_DEVICE_MONO was specified when calling TBASS_Init.

%TBASS_SAMPLE_SOFTWARE

Force the sample to not use hardware DirectSound mixing.

%TBASS_SAMPLE_3D

Enable 3D functionality. This requires that the %TBASS_DEVICE_3D flag was specified when calling TBASS_Init, and the sample must be mono.

%TBASS_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.

%TBASS_SAMPLE_FX


%TBASS_STREAM_PRESCAN


%TBASS_STREAM_AUTOFREE


%TBASS_STREAM_DECODE


%TBASS_SPEAKER_xxx


%TBASS_UNICODE


 

 

Remarks

 

Restrictions

 

See also

 

Examples