r3dux.org

A number-pimping side project from the valleys in *NEW* upside-down flavour.

  • Home
  • ABOUT
  • OLD SITE
  • SEARCH
  • FEEDBACK

An introduction to ActionScript 3.0 – Week 9 – Sound

r3dux | July 25, 2011

In the final week of the ActionScript intro we get into using sounds with ActionScript, and play audio which is external to our flash file(s), embedded within our flash files as well as covering topics like offsetting and repeating. We also create our own custom pause function (because weirdly, the functionality isn’t natively available).

Flash Sound Document

This wraps up all the ActionScript stuff I taught over a brief course about a year ago, and I’ve got to say, I didn’t mind ActionScript 3 as a language at all. You can do a lot of nice bits and pieces with it which can be embedded directly on the web, or you can use it for some quick prototyping (although if you were prototyping some serious effects, you’d probably be more likely to do so in the processing language), so yeah. Glad I spent a month or so getting my head around it.

Download link: An Introduction to ActionScript 3.0 – Week 9
Audience: Beginners who know a little about variables, functions, objects and how to perform some basic programming math.
Format: PDF
Content License: The document, its contents and the provided source code are released under a creative commons non-commercial attribution share-alike 3.0 license by me (r3dux) and comes with no guarantee of correctness, fitness for purpose or anything of the sort. The audio samples used are the property of their respective owners and are used under a fair-use type of deal.

If you’ve followed the series of posts over time, or just stumbled across one week’s worth of notes and found it useful, then I’m happy I went to the effort – and if you’ve learnt something from them then even better ;)

Cheers!

Comments
No Comments »
Categories
Coding
Tags
ActionScript, Audio, Flash, Samples, Sound
Comments rss Comments rss
Trackback Trackback

How To: Fix Broken Sound in ScummVM under Linux

r3dux | January 28, 2010

I’m running Ubuntu 9.10 64-bit, and thought I’d have a look at some old LucasArts gems today – but the version of ScummVM taken from the repos wouldn’t play any sound. So I fixed it.

  • The all-in-one complete fix:
    Fire up synaptic and install libsdl1.2debian-pulseaudio then reboot. Sound (i.e. voice, samples etc) and midi should work absolutely fine now. A potential problem with this fix is that it means you have to uninstall libsdl1.2debian-alsa, which it’s possible you might want to keep. This is the route I finally took, but if I find a bunch of apps are now without sound, I’ll update the post and try to find some other methods.
  • Oh, and if you loose all sound after this (YouTube, Totem etc), then you’ve probably got gstreamer set to use ALSA, but have now removed the sdl-alsa lib, so just run gstreamer-properties and point your audio output to PulseAudio Sound Server then log out then back in. Fixed.

    Update: Although working yesterday, I found I had no sound in flash stuff today (YouTube vids etc), so I installed padevchooser from synaptic, which dragged in a couple of other pulseaudio bits and pieces, launched padevchooser, and then from the icon in the system tray (top-right in Gnome) I just selected Default for Default Server and Default Sink – closed then re-opened firefox and everything’s working again. I guess I didn’t come across this yesterday because I already had Firefox open and using flash (npviewer.bin) with the ALSA plugin already resident in memory and in use.

  • The easy fix to get midi working using ALSA:
    Try running ScummVM from the terminal as pasuspender scummvm – if you can hear midi sound when you start a game, that’s half the battle.
  • The slightly more involved midi fix:
    If the easy fix doesn’t work, grab yourself a midi file from somewhere (like this one) and play it from the terminal with timidity name-of-file.mid. If it plays, jolly good. If not, have you got timidity installed? If you have, and still can’t play a midi, read this.

    I’ll assume you can play a basic midi file from the terminal, but there’s no midi in ScummVM games (which was the situation I was in). So, first we need to find out where our midi ports are at – to do this, run the following line from the terminal: aconnect -o -l

    The output I get is:

    client 14: 'Midi Through' [type=kernel]
        0 'Midi Through Port-0'
    client 128: 'TiMidity' [type=user]
        0 'TiMidity port 0 '
        1 'TiMidity port 1 '
        2 'TiMidity port 2 '
        3 'TiMidity port 3 '

    Midi in ScummVM wants to play on ports 17 or 65 by default, but on my box we can see that port 128 (i.e. client 128) is where the user-land midi ports are at. So now we need to modify the ScummVM config file with that data. So open up the file ~/.scummvmrc with your text editor of choice and add the line alsa_port=128:0 (or whatever your user-land aconnect -o -l output is), or if the line already exists just amend it to point at your midi port.

  • Give ScummVM another go (from the terminal so you can see its output), point the Music driver device at ALSA or Timidity now, and you should at least get midi sound, and see something like the following in the terminal output:

    Connected to Alsa sequencer client [128:0]
    ALSA client initialised [129:0]

    Really though, I think the first option is the best, as I’ve not been able to get voice/samples working with anything other than installing the pulseaudio sdl library. I’ve just put the other options in incase you’ve a strong case against getting rid of libsdl1.2debian-alsa, and if I find there’s one in my case, I’ll come back and update things. But for now, I think I might have a crack at The Dig :)

Comments
1 Comment »
Categories
Gaming, How-To
Tags
Fix, Linux, Midi, Problem, Scumm, ScummVM, Sound
Comments rss Comments rss
Trackback Trackback

How To: Fix Broken Sound in Totem on Jaunty 9.04

r3dux | July 27, 2009

I un-installed ALSA and re-installed a diff version the other day, and somehow managed to lose sound in totem (i.e. movie player) in Ubuntu 9.04. Sound and video was fine in VLC (VideoLan), music played fine in RhythmBox… just no music or sound to avi’s in totem. Anyways, fixed it tonight – here’s how:

Run gstreamer-properties and change your audiosink to ALSA (assuming you’re using ALSA) or whatever you plan on using that works in other apps like this:

gstreamer-properties

Then, open up gconf-editor and change the keys shown in the pic below to alsasink from whatever bastardised string it’s currently at:

gconf-changes

And if all that doesn’t work (which it did for me) – try getting totem-xine or using VLC instead ;)

Comments always welcome if this does/doesn’t work for you.

Comments
2 Comments »
Categories
Linux
Tags
gstreamer, Jaunty, linux-sound-is-often-a-total-dick, Problem, Sound, Totem
Comments rss Comments rss
Trackback Trackback

How To: Get Sound Working in Windows 7 64-Bit running in VirtualBox

r3dux | May 28, 2009

I’m running Ubuntu 9.04 64-bit, and messing around with Windows 7 RC 64-bit as a guest OS in virtual box – but, alas, no sound in Windows…

The fix? Set the virtual machine to use the ICH AC97 virtual soundcard then google for 6285_Vista_APO_PG536.zip and install it inside the virtual box running Windows 7. Annoying start-up sounds are now yours to disable treasure.

Next up will be hardware accelerated graphics – works fine in a 32-bit XP guest OS, no joy in 64-bit Win7 so far…

Comments
1 Comment »
Categories
How-To
Tags
How-To, RC, Sound, VirtualBox, Windows 7
Comments rss Comments rss
Trackback Trackback

How To: Swap between Soundcards in Linux

r3dux | February 4, 2009

Slap the following into a terminal:

asoundconf set-default-card [name of card]

But how do I find out the TRUE NAME of any soundcards are currently recognised so I can fully PWN them I hear you cry? Why that would be:

aplay -l [lower case "L", not "1"]

And if you want to see what output formats are supported by all recognised cards (Stereo [2], 4.0, 4.1, 5.1 etc etc) use:

aplay -L

Just don’t forget that the new default card will only be used for things opened after you issue the command, so to swap and get sound in a browser already running you’d need to restart it.

Also, if you want to test your speakers, use the cryptically named command “speaker-test”, i.e.:

speaker-test -l1 -twav -c6

Switch descriptions (–help for more): 1 loop, use an inbuild sample of a lady saying “Front left, Front Right, Center” etc, and use 6 channels (i.e. 5.1 sound – front left/right, back left/right, center and subwoofer (LFE))

Happy days…

Update: GUI version? How about asoundconf-gtk.. Lovely job.

Comments
No Comments »
Categories
How-To, Linux
Tags
How-To, Linux, Sound
Comments rss Comments rss
Trackback Trackback

Translate

Categories

Archives

Tags

3D ActionScript ActionScript 3.0 Adobe AI Ballarat Bash C++ Class Convert CS4 Effect Film Flash GLSL Gnome Hack How-To install Jaunty Java Kinect Linkage Linux Mash-Up Microsoft Motion OpenGL Particle Photoshop Problem PS3 Remix Remove Retro script Slides Sound Systems Ubuntu Video VirtualBox Wii Windows XBox

Gamercard

OpenR3dux

Misc.

Flattr this

RSS Feed

r3dux twitter feed



“You can tell whether a man is clever by his answers. You can tell whether a man is wise by his questions.”

 - Naguib Mahfouz

rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox