App Inventor Sound component with sound effects added

2,472 views
Skip to first unread message

Gareth Haylings

unread,
Jun 10, 2013, 5:26:08 PM6/10/13
to app-inventor-o...@googlegroups.com
Hi 

Today I thought I would have a go at modifying the App Inventor Source for the 1st. I've wanted to add sound effect so looked at the Sound component and have managed to add a speed setting for playback. I was amazed how easy it was to change and that I did this with out any prior knowledge of JAVA.

I am now going to add some extra functions to the sound components so in total it will have the following:

  • Speed of playback (This can make you sound like your on helium)
  • left and right volume control
  • pan effect
  • Looping (as on the player component)
Attached is a sample test app to show you the effect working.





 



TEST.apk

M. Hossein Amerkashi

unread,
Jun 10, 2013, 7:49:55 PM6/10/13
to app-inventor-o...@googlegroups.com
Good job.
You can also try to integrate the Slider and give it the min / max value of .5 to 2 which are the min / max values that is used for Soundpool.play rate. Then use the slider capture the changed event, get the new value and change the rate on the sound.

-Hossein.

Jos Flores

unread,
Jun 10, 2013, 8:45:50 PM6/10/13
to app-inventor-o...@googlegroups.com
Very cool! That video of you speaking at a +500% speed is very funny! :D

cheers,
José


--
You received this message because you are subscribed to the Google Groups "App Inventor Open Source Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-open-so...@googlegroups.com.
To post to this group, send email to app-inventor-o...@googlegroups.com.
Visit this group at http://groups.google.com/group/app-inventor-open-source-dev?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Gareth Haylings

unread,
Jun 11, 2013, 3:54:08 AM6/11/13
to app-inventor-o...@googlegroups.com
Hi Hossien

Do you mean using the slider as part of the sample project or intergrating it into the properties window in the design like below? 



If I can add it as part of the properties in the designer then this is better than having to type in a value. I code also add a slider control in the designer for pan left/right. Do this would make it a lot easier for beginners using App inventor to understand how the control works.

M. Hossein Amerkashi

unread,
Jun 11, 2013, 8:47:26 AM6/11/13
to app-inventor-o...@googlegroups.com
Hi,

I was talking about slider component as part of sample project. BUT it would be cool if you could add the left / right volume slider into properties. The properties image that you have is Photoshopped or actual implementation?

-Hossein.

Gareth Haylings

unread,
Jun 11, 2013, 9:24:11 AM6/11/13
to app-inventor-o...@googlegroups.com
Photoshopped. Yes would be nice to have sliders like that in the properties windows.

The project was something I knocked up really quickly so would have been better using a slider. I the tend to use app inventor slider control normally. I have made a few custom slider controls which I can change the look of easily http://madrobots.wix.com/themadrobot#!ai-code-snippets/cmrc

I have modified the code further for the sound component so it now has pan right and left (Haven't tested it yet so hope it works) Will test it when I get home from work.

Gareth Haylings

unread,
Jun 11, 2013, 5:46:33 PM6/11/13
to app-inventor-o...@googlegroups.com
I just tested my pan sound left/right speaker code and it worked. The sound component now has the following extra properties:
  • Playback Speed (settings 0 and above)
    50 is half speed
    100 is normal speed
    200 double speed playback
  • Pan_left_right (settings -100 to 100)
    -100 = left speaker on full  &  right speaker mute
      0    = both left & right speaker full
     100  = left speaker mute  &  right speaker on full
I made a small AI project add a clock. I then add a counter variable starting from -100 then in the clock.timer I add the code counter=counter+1 then start sound and set sound.Pan_left_right=counter. This simple project gives effect of the sound moving across the device. Believe me it sound really cool.

Will add looping next then will look at trying to adding some funky sound effects like echoing, chorus & delay to the source code. The way I have emulated the echo effect in my app inventor project in the past is to add a number of player and playing the same sound effect with a small time delay. That method works well but is quite a bit of code. It will be so cool if I actually get extra sound effects added to the source code and means it will be just one block of code  in the block editor. 

One other thing I've also achieved today was to look at the source code for the Button component. I've managed to successfully change it so the font size can be set and displayed in the block editor for the button component. (This has been something I've wanted for along time and it was really easy to sort. It was just a matter of deleting 2 bits of code) 

Taifun

unread,
Jun 11, 2013, 7:24:24 PM6/11/13
to app-inventor-o...@googlegroups.com
sounds great! keep up the good work!
Taifun

scottfromscott

unread,
Jun 12, 2013, 5:06:45 AM6/12/13
to app-inventor-o...@googlegroups.com
From these tweaks you have made, I can imagine a voice scrambler or a voice disguiser for kids. They love this stuff.
---sfs
Message has been deleted

Gareth Haylings

unread,
Jun 12, 2013, 6:55:14 AM6/12/13
to app-inventor-o...@googlegroups.com
Hi Scott

Absolutely. With the sound component change I can see loads of possibilities for project such as :

  • A Talking tom clone
  • Musical instrument (Using one sound rather than lots of media files in you asset)
  • Voice changer. 
  • Advanced sound boards

Once I have finished coding I will create a demo app to try and show what is possible with the sound component features I am adding. The app will be a mixture of the 4 examples I a gave above.


I released a recordable soundboard app on Google Play just before Christmas Called Mad Loops Soundboard(Click here for the link)  About a week ago before I started working on the AI source code I started work on the 2nd version of the mad loops soundboard. I only spent an hour writing. It fully works but is missing the use sound file function. (I have attached the APK for you to play with)  The effects in the app are done with the use of 4 players. The code behind the app is quite complex with over 150 blocks. I can now simplify the code using the sound components changes I've made. I can now change the project and should be able to get it down to roughly 10 blocks in total. If fact it will take the app to whole new level.
CS_sound_pad_custom.apk

Gareth Haylings

unread,
Jun 12, 2013, 5:39:51 PM6/12/13
to app-inventor-o...@googlegroups.com
Volume control now added to the Sound component. Looping next.

I have made a demo app call Talking Squishy.  Squishy is a little blue character who will repeats what you say (Just like Talking Tom but with a few extras). If you move him from left to right the sound pans. Moving Squishy to the bottom of the screen makes him larger, louder and makes his voice deeper. Moving him to the top of the screen makes Squishy smaller, quieter and gives him a higher pitch voice. This demo app should show the potential of using the new sound component effects I've added.

There is very little code but the effects are great.

Jos Flores

unread,
Jun 12, 2013, 7:17:46 PM6/12/13
to app-inventor-o...@googlegroups.com
sounds really cool!

cheers,
José

Gareth Haylings

unread,
Jun 13, 2013, 5:54:27 PM6/13/13
to app-inventor-o...@googlegroups.com
Hi another progress report on the Sound components modes I have made. 

The sound component now has:
  • Pitch/speed effect
  • Volume control 
  • Looping on/off
  • pan left/right speaker
  • isplaying block
1 more thing I will be adding is on player complete event

Below is a link to demonstrating video showing what the Sound component features could be used for.

scottfromscott

unread,
Jun 13, 2013, 9:45:59 PM6/13/13
to app-inventor-o...@googlegroups.com
I played with the app - very nice. Could you use this with multiple tracks/Player components?
That would be all you need for a simple beat box, I think.
I watched your pre-Christmas demo of the Mad Loops Soundboard and was very impressed.
New features like these open up all sorts of possibilities.
---sfs

Gareth Haylings

unread,
Jun 14, 2013, 3:51:32 AM6/14/13
to app-inventor-o...@googlegroups.com
Yes that is how the Mad loops app worked. I had 16 players. The Mad loops 2 will have 16 sound components. I will end up replacing sound components with Players when I sort the effect on the player components.

My daughter was playing with the talking squishy app I demoed in the video this morning and she loved it. It made her laugh.

scottfromscott

unread,
Jun 14, 2013, 4:15:58 PM6/14/13
to app-inventor-o...@googlegroups.com
Child + laughter = right track :)
---sfs

Jos Flores

unread,
Jun 14, 2013, 4:25:11 PM6/14/13
to app-inventor-o...@googlegroups.com
+1
> --
> You received this message because you are subscribed to the Google Groups
> "App Inventor Open Source Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to app-inventor-open-so...@googlegroups.com.
> To post to this group, send email to
> app-inventor-o...@googlegroups.com.
> Visit this group at
> http://groups.google.com/group/app-inventor-open-source-dev.

James Hancock

unread,
Jun 16, 2013, 3:29:25 AM6/16/13
to app-inventor-o...@googlegroups.com
Awesome work!
I've wanted variable speed for a couple of reasons.
Pedometer + known bpm music = multipurpose fitness app speeding or slowing music according to running/walking pace.

Bin Zhao

unread,
Jul 10, 2013, 11:09:35 AM7/10/13
to app-inventor-o...@googlegroups.com
Hi, it was so cool. Now I am making an audio App, How could I use the Sound component with sound effects? I mean in my version, there's no playbackrate. Thanks a lot.

Johnbin 

在 2013年6月10日星期一UTC+1下午10时26分08秒,Gareth Haylings写道:

Gareth Haylings

unread,
Jul 10, 2013, 12:15:34 PM7/10/13
to app-inventor-o...@googlegroups.com
MIT App Inventor doesn't have the sound effects. This is something I have added to my modified version of app inventor called Mad Robots AI. 

Mad Robots AI isn't available yet as am still working on it. To keep up to date with all the mods I am adding visit my website http://madrobots.wix.com/themadrobot#!mad-robots-ai/c99d

Bin Zhao

unread,
Jul 10, 2013, 12:51:34 PM7/10/13
to app-inventor-o...@googlegroups.com
Thanks man. It was really cool. Is the function panning and changing the frequency (showed in the video) available at this stage? Which version should I download? 
I added you on Google chat. If I have more questions, could I ask you there, thank you very much.

在 2013年7月10日星期三UTC+1下午5时15分34秒,Gareth Haylings写道:

Gareth Haylings

unread,
Jul 10, 2013, 7:00:19 PM7/10/13
to app-inventor-o...@googlegroups.com
Panning and changing the frequency are only available in my version of App Inventor which is not yet ready for public release. As soon I am happy with all the changes I've made in the Mad Robots AI I'll make it available for download. Still loads of new features to add before it'll be ready (Sorry no time scale for release date yet).

Bin Zhao

unread,
Jul 11, 2013, 12:32:50 PM7/11/13
to app-inventor-o...@googlegroups.com
Thanks a lot. Hope you can release it soon. Be Looking forward to trying it. Please let us know the date if you think it's ready for public. 
Best wishes,
Johnbin

在 2013年7月11日星期四UTC+1上午12时00分19秒,Gareth Haylings写道:

Siva Teja

unread,
Oct 22, 2013, 11:38:44 AM10/22/13
to app-inventor-o...@googlegroups.com

hello sir,
               I am new to this app inventro. i am not finding any playback rate in the sound component please help me

Gareth Haylings

unread,
Oct 22, 2013, 1:38:50 PM10/22/13
to app-inventor-o...@googlegroups.com
You won't find it in MIT AI as this is a modification I made to my own version of app inventor which is not yet ready for release. Can't give a release date for my modified version just yet as I still have loads to do in it.  check out my website for more details about all the enhancements I am making www.themadrobot.talktalk.net

ahmed salah

unread,
Mar 12, 2018, 2:16:46 AM3/12/18
to App Inventor Open Source Development
dear 
i am see your edited copy off app inv it's amazing  but i still have problem 
Speed of playback (This can make you sound like your on helium) ( how to use this option)
how to build an apk file ??
Reply all
Reply to author
Forward
0 new messages