FrankBz | 4 Apr 2010 01:02
Picon
Favicon

playing a sound in squeak


Hi, I was wondering, what's an easy and quick way to load and play a sound
file, say a wav, in a squeak program?
If you have experience with any other format (midi, mp3, etc.) feel free to
share it. 
What I'm really interested in is how sound works in squeak.

Regards

--

-- 
View this message in context: http://n4.nabble.com/playing-a-sound-in-squeak-tp1750578p1750578.html
Sent from the Squeak - Beginners mailing list archive at Nabble.com.
tocadelius | 4 Apr 2010 14:55
Picon

Re: playing a sound in squeak

FrankBz <kyotosong <at> libero.it> writes:

> 
> 
> Hi, I was wondering, what's an easy and quick way to load and play a sound
> file, say a wav, in a squeak program?
> If you have experience with any other format (midi, mp3, etc.) feel free to
> share it. 
> What I'm really interested in is how sound works in squeak.
> 
> Regards
> 

Hi Frank, 

    Here is a basic load/play....

    thewavfile:= SampledSound fromWaveFileNamed: '(path)\filename.wav'

    (AbstractSound soundNamed:'thewavfile') play

Regards

Nicholas Tocadelius
sergio_101 | 5 Apr 2010 03:10

Re: problems pulling data from a url..

> the problem here is that HTTPSocket httpGet: '' return
> a RWBinaryOrTextStream.
> To get the string, you need to send the message contents to the stream.
> (HTTPSocket httpGet: 'json url') contents
>

thanks!

just getting back to this..

my question is.. how do i know what part of the stream to look at? as
in, how would i know that contents is the part i am interested in?

thanks!

oh.. and i am reading the docs about streams again...

thanks again!

--

-- 

----
peace,
sergio
photographer, journalist, visionary

http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
(Continue reading)

sergio_101 | 5 Apr 2010 03:45

one more parsing JSON..

i am using the json library, and everything seems to be going great..
but i am missing one more piece..

my code looks like this:

results := Json readFrom: geocode readStream.

and it works fine..

the only problem is that there are a few keys that have underscores in
them.. like:

'formatted_address'

when i try to do:

results 'formatted_address'

it bombs..

but any other key that does not have an underscore works fine..

any ideas?

thanks!

--

-- 

----
peace,
(Continue reading)

Cédrick Béler | 5 Apr 2010 12:49
Picon

Re: problems pulling data from a url..


> the problem here is that HTTPSocket httpGet: '' return
> a RWBinaryOrTextStream.
> To get the string, you need to send the message contents to the stream.
> (HTTPSocket httpGet: 'json url') contents
>

thanks!

just getting back to this..

my question is.. how do i know what part of the stream to look at? as
in, how would i know that contents is the part i am interested in?

thanks!

oh.. and i am reading the docs about streams again...

thanks again!



Not sure I understand... :)

A stream encapsulates a collection and provide facilities to navigate forward, backward, etc... (strings are collection - direct string manipulation aren't efficient)...  So you use a stream to manipulate efficiently your string, and to get the string back (or whatever collection that was associated to the string), you send the message #contents.

If you se the class comment of Stream 
"I am an abstract class that represents an accessor for a sequence of objects. This sequence is referred to as my "contents"."


hth, 



 
--



--
Cédrick
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Cédrick Béler | 5 Apr 2010 12:55
Picon

Re: one more parsing JSON..

yes this is a problem related to _ that was used for affectation before. I think this is fixed now in Pharo.


Anyway, a workaround is to change all $_ in another character in the stream you get (maybe changing it to $-).

'test_test' replaceAll: $_ with: $-

hth,

2010/4/5 sergio_101 <sergiolist <at> village-buzz.com>
i am using the json library, and everything seems to be going great..
but i am missing one more piece..

my code looks like this:

results := Json readFrom: geocode readStream.

and it works fine..

the only problem is that there are a few keys that have underscores in
them.. like:

'formatted_address'

when i try to do:

results 'formatted_address'

it bombs..

but any other key that does not have an underscore works fine..

any ideas?

thanks!

--

----
peace,
sergio
photographer, journalist, visionary

http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners



--
Cédrick
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Bruce Prior | 5 Apr 2010 18:12
Picon

Gofer, Metacello

Is there a brief tutorial somewhere that describes Gofer and Metacello? I went to SqueakSource and I see that all the files in Metacello are "Configurationof<Filename>." I am familiar with Monticello and repositories but Gofer and Metacello seem to have crept up on me unawares.
Thanks in advance for your help.
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Bruce Prior | 5 Apr 2010 18:12
Picon

Gofer, Metacello

Is there a brief tutorial somewhere that describes Gofer and Metacello? I went to SqueakSource and I see that all the files in Metacello are "Configurationof<Filename>." I am familiar with Monticello and repositories but Gofer and Metacello seem to have crept up on me unawares. There is nothing in Squeak Wiki about them.
Thanks in advance for your help.
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
John McKeon | 6 Apr 2010 04:43
Picon

Re: Gofer, Metacello

There is a "tutorial" for Gofer on Lukas Renggli's blog here. I'm not sure where there is info on Metacello you can try searching Dale Henrich's blog


Hope this helps
John

On Mon, Apr 5, 2010 at 12:12 PM, Bruce Prior <b.prior <at> ieee.org> wrote:
Is there a brief tutorial somewhere that describes Gofer and Metacello? I went to SqueakSource and I see that all the files in Metacello are "Configurationof<Filename>." I am familiar with Monticello and repositories but Gofer and Metacello seem to have crept up on me unawares. There is nothing in Squeak Wiki about them.

Thanks in advance for your help.

_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners




--
http://jmck.seasidehosting.st
_______________________________________________
Beginners mailing list
Beginners <at> lists.squeakfoundation.org
http://lists.squeakfoundation.org/mailman/listinfo/beginners
sergio_101 | 6 Apr 2010 05:20

You have reached the size limit of the changes file

i have just gotten the following error:

error: 'You have reached the size limit of the changes file. You must
take action now to reduce it. Close this error. Do not attempt to
proceed.'.

what i was trying to do was add a file to a file library..

the size of the file is: 3.4meg

my changes file is: 58.5meg

any ideas?

thanks!

--

-- 

----
peace,
sergio
photographer, journalist, visionary

http://www.coffee-black.com
http://www.painlessfrugality.com
http://www.twitter.com/sergio_101
http://www.facebook.com/sergio101

Gmane