windows x64
https://www.dropbox.com/scl/fi/j7a1ftav ... oi1wr&dl=0
Code: Select all
ImportC "miniaudiosound.lib"
ma_Sound_Init()
ma_Sound_UnInit(engine)
ma_Sound_LastError()
ma_Sound_Free(sound)
ma_Sound_Load(engine,file.s,delay.f=0.0,decay.f=0.0)
ma_Sound_Play(sound)
ma_Sound_Stop(sound)
ma_Sound_Set_Volume(Sound,volume.f)
ma_Sound_Get_Volume(Sound)
ma_Sound_Set_Pan(Sound,pan.f)
ma_Sound_Set_Pan_Mode(Sound,panMode.l)
ma_Sound_Get_Pan_Mode(sound)
ma_sound_set_Pitch(Sound,pitch.f)
ma_Sound_Get_Pitch(Sound)
ma_Sound_Set_Spatialization_Enabled(Sound,enabled.l)
ma_Sound_Is_Spatialization_Enabled(Sound)
ma_Sound_Set_Pinned_Listener_Index(Sound,listenerIndex.l)
ma_Sound_Get_Pinned_Listener_Index(Sound)
ma_Sound_Get_Listener_Index(Sound)
ma_Sound_Get_Direction_To_Listener(Sound,*vec3.Vector3)
ma_Sound_Set_Position(Sound,*vec3.Vector3)
ma_Sound_Get_Position(Sound,*vec3.Vector3)
ma_Sound_Set_Direction(Sound,*vec3.Vector3)
ma_Sound_Get_Direction(Sound,*vec3.Vector3)
ma_Sound_Set_Velocity(Sound,*vec3.Vector3)
ma_Sound_Get_Velocity(Sound,*vec3.Vector3)
ma_Sound_Set_Attenuation_Model(Sound,attenuationModel.l)
ma_Sound_Get_Attenuation_Model(Sound)
ma_Sound_Set_Positioning(Sound,ma_positioning.l)
ma_Sound_Get_Positioning(Sound)
ma_Sound_Set_Rolloff(Sound,rolloff.f)
ma_Sound_Get_Rolloff(Sound)
ma_Sound_Set_Min_Gain(Sound,minGain.f)
ma_Sound_Get_Min_Gain(Sound)
ma_Sound_Set_Max_Gain(Sound,maxGain.f)
ma_Sound_Get_Max_Gain(Sound)
ma_Sound_Set_Min_Distance(Sound,minDistance.f)
ma_Sound_Get_Min_Distance(Sound)
ma_Sound_Set_Max_Distance(Sound,maxDistance.f)
ma_Sound_Get_Max_Distance(Sound)
ma_Sound_Set_Cone(Sound,*vec.Vector3) ;float innerAngleInRadians, float outerAngleInRadians, float outerGain
ma_Sound_Get_Cone(Sound,*vec.Vector3) ;float* pInnerAngleInRadians, float* pOuterAngleInRadians, float* pOuterGain
ma_Sound_Set_Doppler_Factor(Sound,dopplerFactor.f)
ma_Sound_Get_Doppler_Factor(Sound)
ma_Sound_Set_Directional_Attenuation_Factor(Sound,directionalAttenuationFactor.f)
ma_Sound_Get_Directional_Attenuation_Factor(Sound)
ma_Sound_Set_Fade_In_Pcm_Frames(Sound,volumeBeg.f,volumeEnd.f,fadeLengthInFrames.q)
ma_Sound_Set_Fade_In_Milliseconds(sound,volumeBegin.f,volumeEnd.f,fadeLengthInMilliseconds.q)
ma_Sound_Get_Current_Fade_Volume(Sound)
ma_Sound_Set_Start_Time_In_Pcm_Frames(Sound,absoluteGlobalTimeInFrames.q)
ma_Sound_Set_Start_Time_In_Milliseconds(Sound,absoluteGlobalTimeInMilliseconds.q)
ma_Sound_Set_Stop_Time_In_Pcm_Frames(Sound,absoluteGlobalTimeInFrames.q)
ma_Sound_Set_Stop_Time_In_Milliseconds(Sound,absoluteGlobalTimeInMilliseconds.q)
ma_Sound_Is_Playing(Sound)
ma_Sound_Get_Time_In_Pcm_Frames(Sound)
ma_Sound_Set_Looping(Sound,isLooping.l)
ma_Sound_Is_Looping(Sound)
ma_Sound_At_End(Sound)
ma_Sound_Seek_To_Pcm_Frame(Sound,frameindex.q)
ma_Sound_Get_Data_Format(Sound,*Format.long,*Channels.long,*SampleRate.long,*ChannelMap.long,channelMapCap.i)
EndImport
CompilerIf #PB_Compiler_IsMainFile
Global engine,sound,file.s,pan.f=-1.0
OpenConsole()
file = "motat.mp3"
If file <> ""
engine = ma_Sound_Init()
If engine
sound = ma_Sound_Load(engine,file,0.6,0.25)
ma_Sound_Set_Spatialization_Enabled(Sound,1)
If sound
ma_Sound_Play(sound)
Repeat
ma_Sound_Set_Pan(Sound,pan)
ma_sound_Set_Pitch(Sound,1.25)
pan + 0.1
If pan > 1.0
pan = 0
EndIf
Delay(250)
Until ma_Sound_At_End(sound)
PrintN("Press Enter to quit...");
Input()
ma_Sound_Free(sound)
Else
PrintN("Press Enter to quit...");
Input()
EndIf
ma_Sound_UnInit(engine)
EndIf
EndIf
CompilerEndIf