Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5950525
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:24:21+00:00 2026-05-22T17:24:21+00:00

I’m trying to write a streaming audio client and I’d like to use ossaudiodev

  • 0

I’m trying to write a streaming audio client and I’d like to use ossaudiodev functions to help me play back the audio on my local machine. Unfortunately, I’m getting an exception every time I try to run my code:

Unhandled exception in thread started by <function audioplayer at 0x88e96f4>
Traceback (most recent call last):
  File "client.py", line 56, in audioplayer
    audio = ossaudiodev.open("/dev/audio", 'w')
IOError: [Errno 16] Device or resource busy: '/dev/audio'

Here’s my code. Pretty simple methinks, but not sure how to free up the /dev/audio resource.

def audioplayer():

    audio = ossaudiodev.open("/dev/audio", 'w')
    audio.setfmt(ossaudiodev.AFMT_MU_LAW)
    audio.channels(2)
    audio.speed(8000)

    packet = 0

    sleep(.20) # give it a little bit of time to fill ze buffers

    while (packets[packet] != "\0"):
        audio.write(packets[packet])
        packet += 1

Any tricks to this?

Edit: The answer is obvious and stupid. I was playing pandora while running the code, thus the speakers were “busy” doing that. Can anyone clarify why this is so? How can other applications all run multiple audio streams at the same time, yet I seemingly can’t?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T17:24:22+00:00Added an answer on May 22, 2026 at 5:24 pm

    Even on systems where it’s available, the OSS interface is usually just a facade over ALSA. Consider using a library that supports multiple interfaces, such as pyao.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.