473,503 Members | 1,760 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

oss mixer usage

Hi,

I am trying to write a mixer program using the ossaudiodev module.
I could hardly find any documentation or example code, so I try and ask
here.
There are two things that seem to work already, however I am not sure
if the solutions I found are the way it is supposed to be.

First, when on initialization of my MixerController class I query the
properties of the mixer device in use, I tried the following:

self._mixer = ossaudiodev.openmixer()
self.names, self.controls, self.stereocontrols,
self.reccontrols = [], [], [], []
clabels = ossaudiodev.control_labels
for label in clabels:
control = clabels.index(label)
if self._mixer.controls() & (1 << control):
# channel is available
self.names.append(label.strip())
self.controls.append(control)
# now see if it's a stereo channel
if self._mixer.stereocontrols() & (1 << control):
self.stereocontrols.append(control)
# finally see if it is an input device
if self._mixer.reccontrols() & (1 << control):
self.reccontrols.append(control)

This works, at least on my box, however the ossaudiodev.control_label
attribute is not mentioned in the library reference, so I am not sure
if this is the "canonical" way that will always work.

Second, when I want to change the currently used recording source, I am
not sure if I have to provide different code for sound cards that
support multiple active recording source channels and sound cards that
support only one active recording source channel; the code I wrote
works with my card (which allows multiple channels being active), but I
don't have a card that supports only one active recording channel at
hand so I cannot test if the same code will work.
Finally, if it *is* neccessary to provide different code, how can I
find out which type of card is currently in use?

Any pointers are much appreciated.

Thanks in advance

Michael

Jan 16 '06 #1
0 928

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
16053
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels",...
1
2136
by: Mr. x | last post by:
Hello, Flash has a panel which called color mixer. In the color mixer, I can make colors, which are linear / radial colors (changing from one color to another). Can I do this without flash (I...
1
2372
by: Tal Sharfi | last post by:
hi all I need to playback two or more audio files ( .wav files) together. let's say it's a song and a person speaking. I need to control the volume of the two channels, so when the speaking...
2
11581
by: arkam | last post by:
Here is the code : public class AudioMixerHelper { public const int MMSYSERR_NOERROR = 0; public const int MAXPNAMELEN = 32; public const int MIXER_LONG_NAME_CHARS = 64; public const int...
0
1841
by: Dom Lague | last post by:
Hello... I'am creating a program to check the volume and to records sounds from the digital input of my soundcard. I think that the best way to do it is with de winmm.dll api using the sound...
1
10671
by: Andrea V.F. | last post by:
I need to control (Get and Set) this parameters of Windows Audio Mixer: - Master Volume Mute - Master Volume Level In addition, but not mandatory, I need to control also the PC Speaker Mute...
0
3844
by: Anonymous | last post by:
I want to write an application to use the mixer API. I can find out information on how to control a channel volumeor make a VU et.c but nothing on how to select and change channel settings. I...
2
6452
by: =?Utf-8?B?ZGF2ZS5oYXJkeQ==?= | last post by:
Hi, there have been loads of posts about this problem on loads of forums and I have tried everything suggested (except the stuff I’m not comfortable with like deleting drivers and reg. edits). ...
1
2337
by: globalrev | last post by:
import pygame pygame.mixer.music.load(example1.mp3) pygame.mixer.music.play(loops=1, start=0.0) Traceback (most recent call last): File "C:\Python25\myPrograms\pygameProgs\musicexp.py",...
0
7323
jinu1996
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...
1
6984
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...
0
7453
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5576
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5005
isladogs
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...
0
4670
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3162
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...
0
3151
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1507
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.