AutoHotkey Community

It is currently May 27th, 2012, 1:26 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Using BASS.Dll
PostPosted: November 14th, 2009, 6:09 am 
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!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 14th, 2009, 11:09 am 
Online

Joined: April 8th, 2009, 7:49 pm
Posts: 6071
Location: San Diego, California
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=si ... f&oq=&aqi=


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 15th, 2009, 3:58 am 
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?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 17th, 2009, 7:38 am 
Bumpzorz!


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 2:16 am 
Bumpzorz! :P

Sry, just looking for an answer. :)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 20th, 2009, 5:08 am 
Offline

Joined: January 18th, 2006, 7:39 am
Posts: 274
Location: Conway, Arkansas
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.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: iDrug, Ohnitiel and 26 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group