2012-12-14 1 views
0

BASS_StreamCreateFile(path,offset,length,BassFlags)은 항상 '0'을 반환합니다. 이 함수를 사용하는 방법을 이해하지 못합니다. BassFlags의 사용법에 대한 도움이 필요합니다.WPF에서 BASS_StreamCreateFile을 사용하면

추 신 : WPF Sound Visualization Library의 도움으로 이것을 사용하십시오.

감사합니다! 0은 오류가 있음을 알려 때문에

+0

. 스트림을 생성 한 코드를 게시 할 수 있습니까? – ollo

답변

0

, 당신은이 오류의 종류를 확인해야합니다 :

int BASS_ErrorGetCode(); 

이 당신에게 최근 오류에 대한 에러 코드를 제공합니다. 여기

은 가능한 오류 코드 목록 (= 반환 값)입니다 :

BASS_ERROR_INIT // BASS_Init has not been successfully called. 
BASS_ERROR_NOTAVAIL // Only decoding channels (BASS_STREAM_DECODE) are allowed when using the "no sound" device. The BASS_STREAM_AUTOFREE // flag is also unavailable to decoding channels. 
BASS_ERROR_ILLPARAM // The length must be specified when streaming from memory. 
BASS_ERROR_FILEOPEN // The file could not be opened. 
BASS_ERROR_FILEFORM // The file's format is not recognised/supported. 
BASS_ERROR_CODEC // The file uses a codec that is not available/supported. This can apply to WAV and AIFF files, and also MP3 files when using the "MP3-free" BASS version. 
BASS_ERROR_FORMAT // The sample format is not supported by the device/drivers. If the stream is more than stereo or the BASS_SAMPLE_FLOAT flag is used, it could be that they are not supported. 
BASS_ERROR_SPEAKER // The specified SPEAKER flags are invalid. The device/drivers do not support them, they are attempting to assign a stereo stream to a mono speaker or 3D functionality is enabled. 
BASS_ERROR_MEM // There is insufficient memory. 
BASS_ERROR_NO3D // Could not initialize 3D support. 
BASS_ERROR_UNKNOWN // Some other mystery problem! 

은 또한 당신이 제대로 BASS 초기화 한 SHURE 수 있도록 (bass.h에서) - BASS_Init()를 전화를받을해야합니다 전에 스트림을 만듭니다.

BOOL BASS_Init(
    int device, // The device to use... -1 = default device, 0 = no sound, 1 = first real output device 
    DWORD freq, // Output sample rate 
    DWORD flags, // A combination of flags 
    HWND win, // The application's main window... 0 = the current foreground window (use this for console applications) 
    GUID *clsid // Class identifier of the object to create, that will be used to initialize DirectSound... NULL = use default 
); 

예 : BTW

int device = -1; // Default device 
int freq = 44100; // Sample rate 

BASS_Init(device, freq, 0, 0, NULL); // Init BASS 
+0

저음이 올바르게 초기화되었습니다. BASS_StreamCreateFile()이 어떻게 작동하는지 알고 싶습니다. C#에서 작동 코드가 있지만 VB 코드가 작동하지 않습니다. 함수는 항상 0을 반환합니다. – abhi154

+0

그게 왜 * 진짜 * 오류 코드를 확인해야합니다. '0'은 오류가 있음을 알려줍니다. 'BASS_StreamCreateFile()'을 호출하는 곳에서 코드를 게시 할 수 있습니까? – ollo