IRIX C source example of playing sound while doing other things.
#1
IRIX C source example of playing sound while doing other things.
Hi All,

I am writing little irisGL programs and would like to incorporate sound. I have the dmedia .pdf manuals but I have not found a c example of how to play a sound while other things are happening on screen. I would appreciate any examples.

PS. my O2 has only dvaudiotest in the /usr/share/src/dmedia directory

Thank you.

KB
(This post was last modified: 01-14-2021, 05:03 PM by KayBee.)
KayBee
Octane

Trade Count: (0)
Posts: 132
Threads: 40
Joined: Feb 2020
Find Reply
01-14-2021, 05:02 PM
#2
RE: IRIX C source example of playing sound while doing other things.
Hi KayBee,

You can find a simple example here:

http://www.adrianfreed.com/content/audio...g-sgi-irix

In essence, it uses "select" to sleep while nothing interesting happens (i.e. no key is pressed and the audio queue didn't run empty). To make this work with graphics (which need to be updated at least every 50ms), you need to supply a timeout. Read up on select(2) to see the details of that.

That's called "asynchronous I/O", and I personally consider this to be challenging topic for beginners. But so is graphics. And challenges are good, that's how we learn!

"The early bird gets the worm, but the second mouse gets the cheese!"

SGI: Octane MXE, O2, Fuel (defunct), VW320 (defunct)
DEC: PC164, PC164SX, AXPpci
sgt_barnes
Octane

Trade Count: (0)
Posts: 101
Threads: 1
Joined: Mar 2019
Location: Germany
Find Reply
04-09-2021, 06:14 AM
#3
RE: IRIX C source example of playing sound while doing other things.
Ah, great! Thank you sgt_barnes!

I had thought I would not get an answer. Yes I am finding learning C to be a challenge for sure, but graphics has been a blast and I look forward to adding sound.

Thanks again for finding this, and for naming the concept, now I can do further research.

KB
KayBee
Octane

Trade Count: (0)
Posts: 132
Threads: 40
Joined: Feb 2020
Find Reply
04-13-2021, 01:56 PM
#4
RE: IRIX C source example of playing sound while doing other things.
You're welcome, KayBee! That's what this community is here, for!

So I'm looking forward to see your creations!

"The early bird gets the worm, but the second mouse gets the cheese!"

SGI: Octane MXE, O2, Fuel (defunct), VW320 (defunct)
DEC: PC164, PC164SX, AXPpci
sgt_barnes
Octane

Trade Count: (0)
Posts: 101
Threads: 1
Joined: Mar 2019
Location: Germany
Find Reply
04-13-2021, 04:02 PM
#5
RE: IRIX C source example of playing sound while doing other things.
Same, it'll be neat to see what you come up with.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,239
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
04-13-2021, 05:40 PM


Forum Jump:


Users browsing this thread: 1 Guest(s)