Code Monkey home page Code Monkey logo

as3wavsound's People

Watchers

 avatar

as3wavsound's Issues

when using SoundMixer.stopAll() i cant play the sound again

Hi, first tank you for your help and your great work to provide a class that 
hellp lot of people.

What steps will reproduce the problem?

All work great, but when i use
SoundMixer.stopAll();
after that, i cant play the sounds again.

What version of the product are you using? On what operating system?
v0.9, windows 7 64 bit, flash CS6,


Original issue reported on code.google.com by [email protected] on 24 Apr 2013 at 11:28

Incorrect playback of 11025Hz audio.

The attached WAV file (the Devanagari letter "ka" with a horrible goraa accent) 
plays fine in VLC Media Player. With AWS, it makes me sound like a 
chipmunk---if chipmunks spoke Hindi.

Here's the code I'm using in ActionScript3 in an SWF on IE9 on Windows 7 
Professional 64-bit:

    var urlRequest:URLRequest = new URLRequest(soundURI);
    var wav:URLLoader = new URLLoader();
    wav.dataFormat = "binary";
    wav.addEventListener(Event.COMPLETE, playWAV);
    wav.load(urlRequest);  

...

private final function playWAV(e:Event):void
{  
    var tts:WavSound = new WavSound(e.target.data as ByteArray);  
    tts.play();
}   

Original issue reported on code.google.com by [email protected] on 19 Jan 2012 at 6:27

  • Merged into: #7

Attachments:

End of file

What steps will reproduce the problem?
1. Load a wav file from attachment into a demo example.
File was recorded with WAVWriter library:
http://code.google.com/p/speechapi/source/browse/trunk/src/flash/com/adobe/audio
/format/WAVWriter.as?r=15
2. Try to play it (on my machine file is playing correct).
3. I also tried (it didn't helped) to use specific AudioSettings:
new WavSound(new SoundClass() as ByteArray, new AudioSetting(1, 44100, 16);


What is the expected output? What do you see instead?
File is not playing. Error:
Error: Error #2030: End of file was encountered.
    at flash.utils::ByteArray/readBytes()
    at org.as3wavsound.sazameki.format.riff::LIST/splitList()[D:\Projects\Adobe Flash Builder 4.6\Kanarek\src\org\as3wavsound\sazameki\format\riff\LIST.as:65]
    at org.as3wavsound.sazameki.format.wav::Wav/decode()[D:\Projects\Adobe Flash Builder 4.6\Kanarek\src\org\as3wavsound\sazameki\format\wav\Wav.as:38]
    at org.as3wavsound::WavSound/load()[D:\Projects\Adobe Flash Builder 4.6\Kanarek\src\org\as3wavsound\WavSound.as:115]
    at org.as3wavsound::WavSound()[D:\Projects\Adobe Flash Builder 4.6\Kanarek\src\org\as3wavsound\WavSound.as:101]


What version of the product are you using? On what operating system?
version:0.9
operating system: Android 4.0.4 with Adobe AIR/flex




Original issue reported on code.google.com by [email protected] on 25 Oct 2012 at 8:31

Attachments:

synchronizing

1. I'm trying to synchronize two sounds - an MP3 song and a recorded microphone 
output. But when I play the recorded microphone output  through 
WavSoundChannel, it starts with a short delay of about a second(I assume this 
delay is different on different computers).

I tried to use the position of the soundchannel to catch the start of the real 
sound through the speakers, thinking that if the position is greater than 0, it 
should mean that the sound has started playing. But the position is greater 
than 0 and I don't hear the sound yet. I think it returns the right position 
but there is some kind of latency due to encoding. So I cannot use the position 
method to catch the start of the real sound through the speakers.

Is there a listener that I can use to get the actual sound start of the output, 
so i can play both sounds(the recorded output and the MP3) synchronized?


I'm using version 0.8 on Windows 7

Thanks

Kiril


Original issue reported on code.google.com by [email protected] on 23 Jun 2011 at 7:23

delayed wav file play from an already loaded wavsound object

What steps will reproduce the problem?
1. use the code I have provided
2. run SoundManager.playSound(<name>);
3. there is a 1 second delay for me, i have traced to confirm this. The trace 
in playSound traces 1 second before i hear the sound. The sound file is 
confirmed to have no blank space in the spectrum. and it is only 6kb.

<code>: SoundManager.as
public function SoundManager() 
        {
            buildSounds();
            trace("sound manager loaded");
        }

        public function playSound(name:String)
        {
            trace("playing " + name);
            sounds[name][1] = sounds[name][0].play();
            trace("played " + name);
            sounds[name][1].addEventListener( Event.SOUND_COMPLETE, looper );
        }

private function loadSound(path:String, name:String)
        {
            sounds[name] = new Array("", "", path, false, false, 0, 100, 0, 0);
            var wavLoader:URLLoader = new URLLoader();
            wavLoader.dataFormat = "binary";
            wavLoader.load(new URLRequest(File.applicationDirectory.resolvePath(path).url));
            wavLoader.addEventListener( Event.COMPLETE, function(e:Event){makeSound(e,name)} );
        }

        private function makeSound(e:Event, name:String):void
        {
            sounds[name][0] = new WavSound(e.target.data as ByteArray);
        }

        private function buildSounds()
        {
            loadSound("sound/menu/itemDown.wav", "menuItemDown")
            loadSound("sound/menu/itemUp.wav","menuItemUp")
        }
</code>

What is the expected output? What do you see instead?
Instant play, but instead i have a 1 second delayed play.

What version of the product are you using? On what operating system?
v0.9, windows 7 64 bit

Please provide any additional information below.
run in adobe air 3.2 in flash professional cs6

Original issue reported on code.google.com by [email protected] on 5 Sep 2012 at 10:53

Returned SoundChannel position is always 0 (and playback lagging)


1. play a WavSound and keep the returned SoundChannel in a variable
2. using a timer, try to access the SoundChannel.postion during playback
3. the resulting value is always 0. 

Exected output is the current position in ms that the sound has been playing, 
i.e. as with the normal Sound class. I am using the as3wavsound 0.6 version on 
MacOS 10.5.8. with flash CS5.

I added a trace of the current duration (in ms) in the wavSoundChannel class to 
see if I could work around the problem myself:

trace(phase / (_wavSound.samples.length / _wavSound.length));

But, for some reason the actual sound hitting the speakers is lagging with 
about 1 second when I compare it with this trace. I don't mind a delay, but 
since I can't calculate it I can't sync the sound with other sounds. I would 
really appreciate any help on this.

Original issue reported on code.google.com by [email protected] on 14 Oct 2010 at 10:18

start time validation always fails

line 56 in WavSoundChannel looks like:

var maxPositionInMillis:Number = Math.floor(length); 

but should probably refer to the _wavSound.length like:

var maxPositionInMillis:Number = Math.floor(_wavSound.length); 


Original issue reported on code.google.com by [email protected] on 14 Oct 2010 at 10:29

Want to play any file by passing file name

In my case i have 10000 wav (G.711) files for play depending upon contentID. 
can you please let me know how i can accomplish this task. 

After adding AS3WavSoundDemo.swf  expressInstall.swf  index.html files at my 
tomcat server i am able to listen rain_loop file. Can you please tell me how i 
can pass diffrent media file names for play to AS3WavSoundDemo.swf


What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.

Original issue reported on code.google.com by [email protected] on 24 May 2013 at 2:20

leftPeak & rightPeak values don't seem to correspond to volume

What steps will reproduce the problem?
1. Added function to measure volume: 
(100 * ((channel.leftPeak + channel.rightPeak) / 2.0))

2. Value was always very low (or 0), so I decided to measure each value in 
function buffer.

Recorded sample was soft, then loud, then soft. The number seem all over the 
place.

Sample output attached.

Original issue reported on code.google.com by [email protected] on 25 May 2012 at 5:05

Attachments:

soundComplete event is dispatched at the beginning of the playback

What steps will reproduce the problem?
1. add an soundComplete event listener to the channel returned by the play 
method of the class WavSound
2. run the code

What is the expected output? What do you see instead?
should call the callback when the sound finished playing.
but callback is called when sound starts.


What version of the product are you using? On what operating system?
v0.4

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 20 Jul 2010 at 2:16

Enable 16kHz audio playback with provided better upsample algorithm

The current version of as3wavsound doesn't support playback 16 kHz audio, which 
is really required in many cases, especially for speech recognition.

Even we manually remove the limitation for 16kHz in the audio setting, the 
quality of the current upsample impl in Wav.as is not acceptable (the noise).

So in our case, we implemented an upsample replacement:
https://github.com/englishtown/as3wavsound/blob/feature/upsample/src/org/as3wavs
ound/sazameki/format/wav/Wav.as#L81

Out impl is copied from the following stackoverflow ticket:
http://stackoverflow.com/questions/7995470/how-can-i-resample-wav-file

I suggest you guys could consider use this algorithm to replace your current 
one.

Original issue reported on code.google.com by [email protected] on 14 Jan 2014 at 6:08

Example error



var drumLoop:WavSound = new WavSound(new DrumLoop() as ByteArray);
sound.play(); // must be drumLoop.play()

Original issue reported on code.google.com by [email protected] on 28 Mar 2011 at 7:25

Stream support

For large .wav files, there can be a long delay reading them into a bytearray 
before beginning playback.  Similar to flash.media.Sound, WavSound should 
support loading a wav as a stream and not just a ByteArray.

Original issue reported on code.google.com by [email protected] on 16 Jun 2010 at 12:01

Playing different audio streams

What steps will reproduce the problem?
1. Load 2 wave audio files and play them. The files should have around 5-10 
seconds, to have time to notice the problem.


What is the expected output? What do you see instead?
I taught that the files will be played one after another, but unfortunately 
they are played asynchronous, and you can hear both of them at the same time.


What version of the product are you using? On what operating system?
0.8

Is it possible somehow to synchronize the files to be played one after another 
??

Original issue reported on code.google.com by [email protected] on 29 Sep 2011 at 6:40

Playing a wav with a lower samplingRate does not play properly.

What steps will reproduce the problem?
1. Record wav with sampling rate of 11025.
2. Load wav file into WavSound object:
var mySound:WavSound = new WavSound(fileContent, new AudioSetting(1, 11025));
3. Play mySound file: mySound.play();

What is the expected output? What do you see instead?
Expected the audio file to playback properly, but instead it was very 
fast-paced like it was not using the proper sampling rate.

What version of the product are you using? On what operating system?


Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 12 Jul 2011 at 4:25

No leftPeak or rightPeak info from SoundChannel

What steps will reproduce the problem?
I have a ByteArray of sound data captured from the microphone called 
"soundBytes".
var snd:Sound =  new WavSound(soundBytes);
var mySoundChannel = new SoundChannel();
var mySoundTransform = new SoundTransform;
var playbackTimer:Timer;

private function doPlay():void
{
    mySoundTransform.volume = 1;
    mySoundChannel = snd.play(0,0,mySoundTransform);
    playbackTimer = new Timer(100);
    playbackTimer.addEventListener(TimerEvent.TIMER, playbacklevel);
    playbackTimer.start();
}

private function playbacklevel(event:TimerEvent):void 
{
    myProgressBar.width = (mySoundChannel.leftPeak + mySoundChannel.rightPeak)/2 * 100;
}



One would expect the rightPeak and leftPeak on the SoundChannel object to have 
some value other than zero as long there is sound playing, and it does if I'm 
using the standard Sound object, rather than the WavSound object.

This is not the case here...  the rightPeak and leftPeak values are always zero.



Original issue reported on code.google.com by [email protected] on 18 Aug 2011 at 6:47

8-bit WAV files play back garbled

To reproduce:

1. Download or create a WAV file with 8-bit samples (Ex: 
http://simplythebest.net/sounds/WAV/sound_effects_WAV/sound_effect_WAV_files/bub
bles_2.wav)
2. Create a project either with the sound file embedded or downloaded and play 
the sound using the WavSound class.

Behavior:

Instead of the sound being reproduced accurately, a garbled sound of the same 
duration is played.

Original issue reported on code.google.com by [email protected] on 22 Aug 2012 at 11:04

Odd-length .wav files throw error in constructor

Constructing a WavSound instance with odd-length WAV data throws an exception.

Here is sample code that will reproduce the problem:

var wavLoader:URLLoader = new URLLoader();
wavLoader.dataFormat = URLLoaderDataFormat.BINARY;
wavLoader.load(new URLRequest(
    "http://media.merriam-webster.com/soundc11/b/bootes01.wav"));
wavLoader.addEventListener(Event.COMPLETE, function(evt:*):void {
    var sound:WavSound = new WavSound(wavLoader.data as ByteArray);
});

Expected: the constructor returns and the WavSound object is playable.

Instead: an exception is thrown:

    Error: Error #2030: End of file was encountered.

Original issue reported on code.google.com by [email protected] on 30 Aug 2012 at 5:07

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.