1.3.1 beta notes

I’m having trouble with sound in the latest beta. No sound either when selecting the sound from the list or running the app. Tried the standard stuff (close and restart Codea, cold start the iPad) and while other apps are making noise, Codea remains silent.

@Mark Is your iPad on silent? It’s happened to a few people, double tap the home button and check.

Edit: of course if other apps are making sound this is pretty unlikely.

Nope, I seem to running and cranked up to the max–but the only sound I’m getting is key clicks.

If it’s just me, I wouldn’t worry about it until after the next iteration.

That’s really odd. The only other step is to re-install Codea, but that seems a bit extreme and requires you to backup your projects.

My sound is back after the latest update. (shrug)

There used to be a way to get the description (that I see in TestFlight and in the emails) from within Codea. I wanted to get a copy of the new sound example projects, but couldn’t figure out where the links were (email is on a different computer). Has it gone, or am I just imagining things?

Here’s the notes

Great - but I was looking for a more robust solution! Are they no longer accessible from within Codea?

The notes are shown in Codea when TestFlight pops up its “Update Available” box. But once you update it doesn’t do that any more.

You can see the latest notes on the TestFlight page (using the web app).

I am crazy busy at work - but “soundbuffer(data, format, freq)” perked me right up.

What formats, pray tell, are supported?

And - not that I don’t like the new color scheme, but how do you turn it off? Just curious.

Sorry still haven’t got around to putting in the settings panel. That will come soon.

Supported formats:

FORMAT_MONO8, FORMAT_MONO16, FORMAT_STEREO8, FORMAT_STEREO16

(Not too sure how stereo works, whether every second sample is left or right. This is just exposing the raw OpenAL buffer to you)

does this mean one could write a little utility outside codea to convert other formats (eg mid) to these formats?

“the raw OpenAL buffer” should be sufficient for me to research.

And yes, @ruilov, I think that’s exactly what it means. Or I hope so. Probably not .mid, which is tones/durations/velocity, but I’m hoping sound samples. We should know later tonight or tomorrow :slight_smile:

And - it looks like it’s PCM, which is rockin.

@Dylan told me that stereo works by having the left samples then the right samples. So it’s not interleaved. It’s just the two buffers concatenated.

interesting: “A PCM stream is a digital representation of an analog signal, in which the magnitude of the analog signal is sampled regularly at uniform intervals, with each sample being quantized to the nearest value within a range of digital steps.” (wikipedia)

so you could potentially take anything that plays to your sound card and convert to PCM no? (sorry I’m a super beginner on this stuff)

That’s my understanding.

This is the digital sample player I’ve been wanting - I think. It should be as simple as getting a big blob of PCM sound data, dropping it into the buffer, and playing it. AND because it’s OpenAL, it should handle things pretty well - I suspect there’s ways to drop in MP3 and the like. Not 100% sure on that, but the PCM should work.

I’ll know, tonight I hope. Or I’ll post code asking for help :slight_smile:

It is sampled at 44100, not sure we need that much for decent sound (but what do I know). Anyway, once we have some way to import sprites, my suggestion would be to have a way to import wav files as well

@Bortels, success!

http://ruilov.posterous.com/audio

(fair warning, it’s half a meg)

Downloaded this thing called foobar, converted to 8-bit, mono wav, printed out the bytes to Data.plist and it worked the first time.

Oh, maaaannnn… you beat me by maybe 30 minutes. I have my sound file, it’s encoded - I just needed to write a decoder. Congratulations!

I like how you handled “a … b” causing performance issues :slight_smile:

Now - question is - can it handle compressed data, like mp3? Probably not at this point given the formats, but I’m hoping it’s easy to add. A half a meg for 3 seconds of audio is a lot. :slight_smile:

While I’m making suggestions - @Simeon, how hard would it be to turn on the microphone and have it fill a buffer? Just askin :slight_smile: