in Education by
What is the required API configuration/call for playing two independent wavefiles overlapped ? I tried to do so , I am getting resource busy error. Some pointers to solve the problem will be very helpful. Following is the error message from snd_pcm_prepare() of the second wavefile "Device or resource busy" JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can configure ALSA's dmix plugin to allow multiple applications to share input/output devices. An example configuration to do this is below: pcm.dmixed { type dmix ipc_key 1024 ipc_key_add_uid 0 slave.pcm "hw:0,0" } pcm.dsnooped { type dsnoop ipc_key 1025 slave.pcm "hw:0,0" } pcm.duplex { type asym playback.pcm "dmixed" capture.pcm "dsnooped" } # Instruct ALSA to use pcm.duplex as the default device pcm.!default { type plug slave.pcm "duplex" } ctl.!default { type hw card 0 } This does the following: creates a new device using the dmix plugin, which allows multiple apps to share the output stream creates another using dsnoop which does the same thing for the input stream merges these into a new duplex device that will support input and output using the asym plugin tell ALSA to use the new duplex device as the default device tell ALSA to use hw:0 to control the default device (alsamixer and so on) Stick this in either ~/.asoundrc or /etc/asound.conf and you should be good to go. For more information see http://www.alsa-project.org/main/index.php/Asoundrc#Software_mixing.

Related questions

0 votes
    We're working with play framework 2.6.21 (but we're able to reproduce it with play 2.6.19 ). ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 27, 2022 in Education by JackTerrance
0 votes
0 votes
0 votes
    Football teams `T_(1)` and `T_(2)` have to play two games against each other. It is assumed that the outcomes of the ... D. `(1)/(2)` Select the correct answer from above options...
asked Nov 13, 2021 in Education by JackTerrance
0 votes
    What happens if two threads simultaneously modify TreeSet? (a) ConcurrentModificationException is thrown (b) Both threads ... of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    What will happen if two thread of the same priority are called to be processed simultaneously? (a) Anyone ... Multithreading of Java Select the correct answer from above options...
asked Mar 1, 2022 in Education by JackTerrance
0 votes
    Two coins are tossed simultaneously 500 times with the following frequencies of different outcomes: Two heads: 95 ... these events. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Two dice are thrown simultaneously. If X denotes the number of sixes, find the expectation of X. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Two coins are tossed simultaneously. What is the probability of getting (a) at most 1 tail (b) at least 1 tail. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Two dice are rolled simultaneously. Find the probability of getting a doublet of even numbers. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Two dice are rolled simultaneously. Find the probability of (a) getting a total of 11. (b) getting a sum greater ... 3 on the other. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    A bag contains 10 tickets numbered 0, 1,2 ....9. Two tickets are drawn at random simultaneously. What is ... the other ticket number. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Two coins are tossed simultaneously 500 times and the outcomes are noted as given below: Outcome: Two heads (HH) One ... (iii) No head. Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
0 votes
    Two coins are tossed simultaneously. What is the probability of getting at most one head? Select the correct answer from above options...
asked Nov 25, 2021 in Education by JackTerrance
...