B4A Library Audio library v1.2 - Beeper

Status
Not open for further replies.
Audio library was updated and it now supports generating "beep" sounds.

B4X:
Dim b As Beeper
b.Initialize(300, 500) '300 milliseconds, 500 hz
b.Beep
Once the object is initialized you can reuse it and play it multiple times.
Documentation: http://www.b4x.com/android/help/audio.html

Installation instructions:
- Download the attached file.
- Copy both files to the internal libraries folder: C:\Program Files\Anywhere Software\Basic4android\Libraries
 

Attachments

  • Audio.zip
    16.8 KB · Views: 2,086

MikeH

Well-Known Member
Licensed User
Longtime User
Measuring with a standalone tuner and a software tuner on my pc.

I have also checked on another Android phone and have the same results.
 
Last edited:

MikeH

Well-Known Member
Licensed User
Longtime User
Ok, thanks for looking into it.
 

muruganthunai

Member
Licensed User
Longtime User
Waveform generation

:sign0163:
Can anyone help me to generate Sine, Square, Triangle, awtooth and Pulse waveform (with variable frequency and amplitude) using Beeper or any other means using Basic4abdroid?
Thanks in anticipation,
Murugesan
Lecturer
Arasan Ganesan Polytechnic College
Sivakasi
Tamilnadu
India
 

stevel05

Expert
Licensed User
Longtime User
Have a look at the AudioTrack library here

The swt1-3.zip demo app creates a sine wave which you can use as a basis for the rest of your needs.
 

JordiCP

Expert
Licensed User
Longtime User
Multiple sounds

Hi all,

I am quite new here. Have been programming for several years but still getting into android apps, and a lot to learn

I am writing a small app in which there is a drawed keyboard, and want it to sound as the user touches the different keys

As a very first approach i have used the beeper. I created an array of 14 beepers, each one with a different frequency and 300msec. When I hit the keyboard it sounds. If I hit a second key, it sounds the new beeper, even if the previous one isn't finished

When do this (start one beep before the previous one has ended) sometimes my device reboots. I don't know if it is due to the fact that beeper does not support simultaneous plays of instances to this object or something more in my app. Is this the point or am I missing something?

Also, in the future I would like the app to play different "custom" sounds (previously stored as a file) assotiated to each key in the keyboard, and I want to be able to play some (different channels) of them at the same time:

> which file format is more suitable (requires less memory and/or less processing for the device) for this purpose?
> which player object would you recommend, also taking into account memory and performance issues?

Any advice would be welcome :sign0163:


Jordi
 

stevel05

Expert
Licensed User
Longtime User
Hi Jordi,

Have a look at soundpool using Ogg sounds. That will easily accomplish what you are after.

via Tapatalk
 

DaveW

Active Member
Licensed User
Longtime User
Is there a way to play 2 beeps after each other without them interfering? I'm not trying to make a full synthesizer, I just want the option of 'beep' or 'beep__beep'

Thanks for any help
 
Status
Not open for further replies.
Top