Simple wav playback using alsa

Posted on 2004-11-16
Last Modified: 2012-05-05
Dear experts.

I'm looking for a simple C/C++ API for playing short WAV file with ALSA as the sound engine. As simple as one line Windows API if possible:
  PlaySound("mysounf.wav", ..., ... );

however, any short example will be appreciated.

Thank you.
Question by:Kocil
    LVL 3

    Accepted Solution

    Alsa has the aplay program with it, that does just that. Check it's source to find what you need.
    LVL 5

    Author Comment

    I've been doing that, and wonder why it is so complicated ?

    LVL 3

    Expert Comment

    I don't know. Check "For ALSA Software Developers"
    maybe something useful is there.

    Or go ask on #alsa on

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
    The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now