473,597 Members | 2,113 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.ope nmixer()
self.names, self.controls, self.stereocont rols,
self.reccontrol s = [], [], [], []
clabels = ossaudiodev.con trol_labels
for label in clabels:
control = clabels.index(l abel)
if self._mixer.con trols() & (1 << control):
# channel is available
self.names.appe nd(label.strip( ))
self.controls.a ppend(control)
# now see if it's a stereo channel
if self._mixer.ste reocontrols() & (1 << control):
self.stereocont rols.append(con trol)
# finally see if it is an input device
if self._mixer.rec controls() & (1 << control):
self.reccontrol s.append(contro l)

This works, at least on my box, however the ossaudiodev.con trol_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 943

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

Similar topics

12
16087
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", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3)
1
2143
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 only want to create a bitmap like this) ? Is there any web-site that includes free images that are linear/radial colors ? Thanks :)
1
2385
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 file is playing, the song volume is lowered. can someone point me to a simple example in c-sharp (or other .net language) thats implements some kind of audio mixer?
2
11603
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 MIXER_SHORT_NAME_CHARS = 16; public const int MIXER_GETLINEINFOF_COMPONENTTYPE = 0x3;
0
1848
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 mixer. But I dont understand how to use it. I'am working in vb.net. I want to know if I have to import the winmm.dll into my references or I just have to use the functions like this: Private Declare Function mixerOpen Lib "winmm.dll" Alias...
1
10676
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 and Volume. PC Speaker control is aviable only in some Systems such as laptops, in others systems there is no control of PC speaker in Windows Mixer.
0
3850
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 want my application to alter the mixer recording channels on entry and set them back on exit. Anyone got a good link or example of this?
2
6461
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). I have an HP Pavilion dv2130ea laptop computer with XP media edition and sp2. I have had lots of automatic updates recently. When I boot my computer, everything is fine.
1
2351
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", line 3, in <module> pygame.mixer.music.load(example1.mp3)
0
7969
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7886
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,...
0
8381
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 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...
1
8035
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,...
0
8258
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6688
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
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 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...
0
3886
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...
1
1494
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.