AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Using BASS.Dll

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Sat Nov 14, 2009 5:09 am    Post subject: Using BASS.Dll Reply with quote

I've come to need the use of BASS.Dll. However, I'm having trouble figuring it out. I've got the Dll file, as well as BASS.Ahk.

Can someone post a code snippet that will simply play an audio file? I have:

Code:
#Include bass.ahk

#NoEnv
#SingleInstance Force
#Persistent

BASS_Load()
BASS_Init()
File := A_ScriptDIR "\Test.mp3"
Stream := BASS_StreamCreateFile(false,file,0,0,4)
BASS_ChannelPlay(Stream,0)


... But it fails to play the file. Maybe also a snippet of how to find the current position in the file?

Many thanks to whoever may take the time to help me out!
Back to top
Leef_me



Joined: 08 Apr 2009
Posts: 1158
Location: San Diego, California

PostPosted: Sat Nov 14, 2009 10:09 am    Post subject: Reply with quote

My apologies if you've already tried this, but did you try searching for BASS related code ?

http://www.google.com/search?hl=en&q=site%3Aautohotkey.com+%2Bbass&aq=f&oq=&aqi=
Back to top
View user's profile Send private message
Guest






PostPosted: Sun Nov 15, 2009 2:58 am    Post subject: Reply with quote

Lex actually pointed me in the right direction on the live chat feature.

File needed the & symbol before it (&File). Sad I didn't notice that myself. Lol.

Any ideas is BASS.Ahk or the other ones include functions that can be called to find the current position in a given created stream?
Back to top
Guest






PostPosted: Tue Nov 17, 2009 6:38 am    Post subject: Reply with quote

Bumpzorz!
Back to top
Guest






PostPosted: Wed Nov 18, 2009 1:16 am    Post subject: Reply with quote

Bumpzorz! Razz

Sry, just looking for an answer. Smile
Back to top
skwire



Joined: 18 Jan 2006
Posts: 267
Location: Conway, Arkansas

PostPosted: Fri Nov 20, 2009 4:08 am    Post subject: Reply with quote

Here's one way of getting the current second of a track:

Code:
Curr_Position := Floor( BASS_ChannelBytes2Seconds( hStream, BASS_ChannelGetPosition( hStream, 0 ) ) )


This is how I do it within Trout, anyway. Of course, change "hStream" to whatever variable you're using for the handle.
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group