I use ctypes to play AUDIO using bass.dll found here: Un4seen Developments - 2MIDI / BASS / MID2XM / MO3 / XM-EXE / XMPlay
I have gone so far and tried as they advised me at their forum entry here: New Python Developer with Bass
But I still get errors. Can anyone take code and analyze to point out source of error?
Here is the code, pse ignore any useless comment, I was using the editor as scratch pad too :D - #import ctypes module
-
import ctypes as ct
-
#import OS
-
import os
-
#get BOOL C++ value from ctypes
-
from ctypes.wintypes import BOOL
-
from ctypes.wintypes import HANDLE
-
#Loading the DLL see: http://www.daniweb.com/forums/thread160430.html
-
bass_dll = ct.windll.bass
-
#initialize the DLL
-
# sample I got somehwere: BASS_Init(-1,44100,0,win,NULL) win The application's main window... 0 = the current foreground window (use this for console applications).
-
#function to intialize the DLL
-
-
def onInit_Lib():
-
#define arg types
-
bass_dll.BASS_Init.argtypes = [ct.c_int, ct.c_int, ct.c_int, ct.c_int, ct.c_int]
-
#define result types
-
bass_dll.BASS_Init.restype = ct.c_int
-
#call function with args
-
c= bass_dll.BASS_Init(-1, 44100, 0,0, 0)
-
print c
-
-
def onStream():
-
#arg definitions
-
#HSTREAM BASS_StreamCreateFile(BOOL mem, void *file, QWORD offset, QWORD length, DWORD flags);
-
bass_dll.BASS_StreamCreateFile.argtypes = [BOOL, ct.c_char_p, ct.c_int , ct.c_int, ct.c_int]
-
#defining restypes
-
bass_dll.BASS_StreamCreateFile.restype = HANDLE
-
path = os.getcwd()
-
full = os.path.join(path, "test.mp3")
-
print full
-
stream = bass_dll.BASS_StreamCreateFile(False, full, 0, 0, 0)
-
print stream
-
return stream
-
-
def onPlay(stream):
-
#define args
-
#BASS_ChannelPlay(stream, FALSE); // play the stream
-
bass_dll.BASS_ChannelPlay.argtypes = [HANDLE, BOOL]
-
#call function
-
bass_dll.BASS_ChannelPlay(stream, False)
-
-
onInit_Lib()
-
stream = onStream()
-
onPlay(stream)
-
With thanks,
0 1308 Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Edward King |
last post by:
Hi!
I am trying to achieve the following:
I have a number of help pages (in the format help_nn.php where nn=helpid).
I want to be able to open a particular help page by calling the function
gethelp(nn) where nn is the helpid.
The function is contained in a header file called funcs.inc that each page
|
by: sunfox |
last post by:
Please help!! I have a difficulty in writing an assignment which is
related to Visual C++ V6.0. Can anybody here assist me to write a
program which is able to run under DOS? The program will be used in
Car Park Management, Library Management and Yellow Page Management.
For the purpose of fully understanding explanatory notes should be
added for each Source Code.
Many thanks in advance!!!!
|
by: d.warnermurray |
last post by:
I am doing a project for school that involves creating help files for a html
authoring tool.
If you could help me with answers to some questions it would really help.
1. What tasks do you expect an html authoring tool to help you accomplish?
2. What do you expect from online help for a html authoring tool?
3. What audience do you think a freeware html authoring tool is directed
towards?
|
by: dixie |
last post by:
Help, I'm really out of my depth here (not unusual I hear you say :-). I
have just installed HTML Help in an application. I told it in the Project
Properties the path to the help file. I then type in a command line that
runs the help in the correct Context from a button on each form. It all
worked fine - HERE.
The problem is that when I sent it out to a site, the help file was not able
to be accessed because it was my path in the...
|
by: Paul Rubin |
last post by:
In Windows if you click the Help dropdown, IDLE launches a help window
as it should. The help contents are included in the installation.
In Linux, clicking Help launches a web browser, which is a perfectly
good UI for viewing help. However, instead of loading a static HTML
file from the disk like the Windows version does, it visits the doc
directory on python.org over the internet.
Is there any reason for that? It's noticably slower...
| |
by: glenn123 |
last post by:
Hi, i am just about out of time to produce a working jukebox which has to perform these functions: to play music files when a track is chosen from a list which when the user presses the change genre button the list is populated with a list of that genre.
I have got the interface done to satisfaction, my problem is that when i press the change genre button nothing happens and when i select a track to play from the list which is setvisible and...
|
by: JonathanOrlev |
last post by:
Hello everybody,
I wrote this comment in another message of mine, but decided to post it
again as a standalone message.
I think that Microsoft's Office 2003 help system is horrible, probably
the worst I
ever seen.
I almost cannot find anything I need, including things I
|
by: davy.zou |
last post by:
I have started learning c++ and I need help. I need to write a
program, the question is as follows.
At a post office, there are a certain number of 2, 7, and 9cents
stamps, now, given a total number of cents required, find the correct
and most effective combination of stamps.
meaning that if you were to need 14cents, the correct output should be
2 seven cents not 7 two cents.
|
by: dsoutherland |
last post by:
I am so new to ASP I'm not sure I am breathing. A company one of my clients deals with provides information over the web. They provided the ASP code for a default web site that is used to communicate with them and I have installed it and coded a VB6 app to provide the interface. Here is the problem. The ASP gets an error "Exception occurred" message. When I respond to the error, the returned XML is not received. Also, the ASP stops via the...
|
by: menyki |
last post by:
help 'e debug
--------------------------------------------------------------------------------
I wrote the below code to input new data from name and address textbox of a form to microsoft access but there are alot of error. the name of the table in the access is Hotel and the the fields are HotelName and HotelAddress . Please can somebody help me and debug. i used vb.net
Note: almost all the line is underlined with red line indicating...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |