Actionscript 3.0 :: Sound Channel Won't Construct When Speakers Are Not Present
Aug 26, 2009
I built an application on Windows XP and Vista. And it seems that the sound channel constructor decides not to run with no speakers attached. Runs fine when headphones are plugged in, but when no speaker device is present the Sound object is constructed, but the Sound Channel never seems to make it.
View 1 Replies
Similar Posts:
Sep 1, 2009
I built an application on Windows XP and Vista. And it seems that the sound channel constructor decides not to run with no speakers attached. Runs fine when headphones are plugged in, but when no speaker device is present the Sound object is constructed, but the Sound Channel never seems to make it.
I did some testing and even the most basic Sound Constructor fails to create the default sound channel if there are no speakers connected.
In the following example channel turns up as null if no speakers are present on a Windows machine. I/O Error doesn't throw anything for me either.
This is a modified version of the example from the Adobe Docs:
Code:
private var channel:SoundChannel;
public function sound_test(){
var request:URLRequest = new URLRequest("audio.mp3");
[Code]...
View 3 Replies
Aug 13, 2007
I'm using the activityLevel of the Microphone (because its the only thing, it seems, Flash can use from it) to perform certain actions, based on how loud the Microphone activity is.
That works fine.However, all sound picked up by the microphone is forwarded to the speakers.I need the speakers for sound F/X so I can't just turn them off. But I really don't want the microphone audio to be played over them.I tried using setGain(0); but that not only killed the mike sound to the speakers but the ability to sense sound from the mike at all.
I tried setSilenceLevel(0); and setSilenceLevel(100);
But that didn't seem to effect it either.
setUseEchoSuppression(false); and setUseEchoSuppression(true); also had no positive effect.
So... Is there any actionscript left to try?I just need to prevent the speakers from repeating what the computer hears from the Microphone, while still allowing Flash to read and react on varying levels of activity from the microphone.I recieved 6 pages from the keyword microphone. None of them addressed or came near to addressing the problem I'm having.
View 2 Replies
Dec 5, 2010
The code seems OK but I can't hear the sound. I have it in the fla/swf and exported etc... I suppose something in this code is wrong. Haven't coded for ages - bit rusty I'm afraid.
[Code].....
View 3 Replies
Apr 1, 2011
The only way i can describe this is showing the code I have already then trying to explain what i want to do.Basically, I am creating a soundboard game, where at the bottom of the screen I will have a bar which is a movieclip, and I will be dragging other movieclips onto it and then clicking pay, and using an array and .push they will play in order. I am trying to put the sounds onto the movieclips using code.[code]...
View 2 Replies
Jan 8, 2010
The pause button in my MP3 player resets the track to the beginning, there is something wrong with my sound channel because when i trace the position it is always zero.[code]...
View 1 Replies
Apr 5, 2010
Is there a better way to use the sound channel is AS3?
var mySound:Sound = new Sound();
playButton.addEventListener (MouseEvent.CLICK, myPlayButtonHandler);
var myChannel:SoundChannel = new SoundChannel();
function myPlayButtonHandler (e:MouseEvent):void {
[code]....
View 2 Replies
Sep 14, 2011
I know the SoundMixer.computeSpectrum and Sound.extract() methods , but those methods deal with the total sound output. Instead, is there a way to deal with every single SoundChannel, so as to provide a graphical visualization of each of them?
View 1 Replies
May 27, 2011
Cannot read property (or target) a Sound thats playing in a SoundChannel.... in this case I am refering to a class the extends the Sound class (SoundEffect class), that is currently playing in a SoundChannel. Each SoundEffect has a volumeLevel property that I would like to restore once I have unmuted the SoundEffect's in my application. I cannot figure out how to target that property once its playing in the Channel.I am extending the Sound class:
ActionScript Code:
public class SoundEffect extends Sound {
public var ID:String;
[code].....
View 9 Replies
Sep 23, 2009
Does anybody know a way to detect what audio is currently being played through a sound channel. i.e. if I set a sound name to "_hitting", and attach this to "mySoundChannel", then mySoundChannel = _hitting.play(); is there any request that will tell me that "_hitting" is being played?
View 2 Replies
Jan 13, 2011
I have made a little mashup mixing maps, translate api and flickr. I get the directions from my map and make mp3 files on the fly to play them at the same time but they only play in firefox and for the rest of the browsers I only get my first sound channel with background music. can't figure out why.
[Code]...
View 1 Replies
May 26, 2011
I Am wondering if is possible to use one sound channel to play through an array of sounds? Perhaps by using a complete event or other means?
View 1 Replies
Jan 18, 2011
In the following code how to mute the speakers
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="http://www.adobe.com/2006/mxml"
[code]....
View 1 Replies
Sep 29, 2011
I was debugging sound in an app and decided to make a little test case as I kept getting odd errors... well I just moved to a new desk yesterday so hadn't hooked up speakers yet. Here's the test:
var backSound:Sound = new bgSound();
var backChannel:SoundChannel = backSound.play(0, 999);
trace(backChannel);
bgSound is just a library sound... if my speakers are unplugged from the sound card backChannel returns null. If speakers a plugged in backChannel is a soundChannel object.
View 1 Replies
Jul 31, 2011
this is my first time making anything on flash. I have cs5. I've designed an mp3 player control menu as well as a big speaker in photoshop and put everything into flash. I followed a tutorial which shows how to animate a speaker in real time using the song that's playing as a reference for how much the speaker animates.
the code for the speaker bounce is this
bounce.width = ( Math.round(channel.leftPeak * 8) ) + 259.10;
bounce.height = ( Math.round(channel.leftPeak * 8) ) + 259.10;
everything works fine on my mp3 player except the speakers wont animate.
259.10 is the original size of my speaker which is supposed to change size according to how booming the song playing at the moment is.
the only difference that i can see between my file and the tutorial's file is that the speaker in the tutorial says "drawing object" under properties and mine says "shape"
does this have anything to do with why the width and height of my speakers are not changing as the code says it should?
View 3 Replies
Dec 31, 2011
I am playing around with saving .xml files from data in my game. I know how to convert an xml object to a ByteArray and write that to a FileReference. What I need to know now is how to go from an empty xml object (using var xml:XML = new XML()) to a fully populated xml object.
Can someone show me what functions to use to add nodes and values? Specifically I need to know how to make several of the same type of node. Here's a sample of what the final xml should look like[code]...
View 2 Replies
Jan 6, 2012
I have an idea for a web site image in which a 3d object moves across a background, turning as it moves and thereby demonstrating its 3d nature. Obviously, Flash supports design of the static background and the motion of the object. But can Flash construct that 3d object with the complexity of say for example Autodesk? If not, and I have to construct the object with a 3d design application, what 3d file formats does Flash support?
View 6 Replies
Feb 21, 2009
I am trying to construct a timed loop... so far without success.What I need is a loop where iteration 0 + i + 1 starts a few seconds after iteration 0 + i. I tried putting a timer inside the loop but the loop seems to simple skip the timer instead of executing it sequentially before starting the next iteration. Here is the code snippet:
Code:
var iTimer : Timer;
for( var i:int = 0; i < 2; i++ )
{
trace( i + " i iterations" );
[code]....
The loop does not seem to wait for jLoop() to be executed. It speeds ahead onto the next iteration, instantiating a new timer and thus screwing up the timing of the iterations. I have tried different things like putting break and continue statements in there but to no avail.
View 8 Replies
Mar 12, 2010
how I can avoid this type of ridiculous code I am having to use:
function resetText():void {
pathText_textField_1.text = "";
pathText_textField_2.text = "";
[Code].....
In lingo I would run a repeat loop using the base "pathText_textField_" and adding the number as a string for each one. Is this possible in as3? I mean can I construct the mc reference using code somehow? I can of course make the names as a string in a loop but you cannot use a string as a mc name right? If not then how else can you send the same instruction to multiple mcs?
View 6 Replies
Jan 6, 2012
When using Adobe Flash Media Live Encoder, it doesn't seem to recognize my system speakers, so I can't record system audio.
View 1 Replies
Jan 12, 2011
How do I pass values by reference inside a for each construct in AS3? Basically, I want something equivalent to the following code in PHP:
foreach ($array as &$v) {
$v = $v + 1;
}
This would allow me to change all elements of the collection $array through a single loop.
View 3 Replies
Aug 10, 2010
So what will be faster:a) From actionscript construct library items and put on stage and Tween;b) Or keep those library items on stage, but not on visible zone and then with actionscript make them appear with a Tweener?
View 9 Replies
Dec 25, 2010
I declare this class which has a value x (In it's own document)[code]...
View 3 Replies
Oct 30, 2005
How to construct a preloader for the thumbnails in the xml gallery.
So far, I've got Code:
this.onEnterFrame = function() {
nfilesize = tscroller.getBytesTotal();
nloaded = tscroller.getBytesLoaded();
thumbpreload._visible = true;
if (nloaded != nfilesize) {
thumbpreload.thumbpreloadbar._xscale = 100*nloaded/nfilesize;
else {
thumbpreload._visible = false;
}};
I'm having 2 problems (that I know of)... I'm not sure that "tscroller" is the movieclip I want to preload for the thumbnails, and I can't get my movieclip entitled "thumbpreload" (which is set _visible = true; here) to show up. This preload function seems to conflict with the main image preloader and cause it to stop working. The file I'm using can be found here: [URL]
View 2 Replies
Mar 19, 2006
I'm an intermediate AS2 coder starting to use better OOP practices. I have searched for the answer to this but have not found anything, perhaps because everyone else learned it a long time ago.It appears that classes which extend an MC which is contained inside a different MC do not run their constructor immediately after the containing MC is instantiated. Also this MC's methods are not immediately available. As a result I need to wait a bit, by using onLoad or another frame.Here is an illustration which I have made as slim as possible:
LIBRARY:
--Symbol with ID "ball", linked to AS2 class "Ball".
--Symbol with ID "box", linked to AS2 class "Box". This symbol contains an instance of "ball" which I dragged in there and gave an instance name "ball_0".
--Symbol with ID "launcher", linked to AS2 class "Launcher".[code].....
QUESTIONS: How can I fix this so that setB would work in the above example? I have found two workarounds but I wonder if there is another which feels less kludgy.
Solution A): As seen in the example, put into Ball an onLoad function (or maybe just its constructor) which then runs any initialization functions. As a result I need to store in the object some properties which the object can find in itself and use for initialization.
Solution B): Put the method call on a timeline frame after the frame in which the attachMovie is done.
At the heart of this question is, why can I set the ball's properties (as seen with setA) but not be able to call its methods successfully? On one hand, I can see that the thread is busy with the box's initialization and can't be expected to run ball's constructor right away, even though ball has been instanced. But on the other hand, I am actually calling a method of an instance which is obviously there, so shouldn't it have the common decency to do as I ask?
Bonus question is, is the fact that this does not work a bug in Flash AS2 or is it perfectly to be expected due to some CS common sense which I lack?Another bonus question is, is this a harebrained way to use Flash AS2 classes—linking symbols to AS2 classes which extend MovieClip (or which are subclasses of classes which themselves extend MovieClip), and using attachMovie to instance all of these MCs except the one "Launcher" which is the only thing on the .fla's stage? It's a cornerstone of my architecture so I'd like to know if this is utterly daft.
View 4 Replies
Aug 25, 2009
How do you properly set a public variable or property in a construct? I'm pretty sure this is the wrong way of going about it:
Code:
private var subNavLoader:Loader = new Loader();
public var type:String;
public var w:Number;
public var h:Number;
public var path:String;
[Code] .....
View 5 Replies
Apr 21, 2009
I'm seeing lots of cool clocks made in flash, but they load the time based on your machine's date and time. I want to construct a clock which takes the time from an official time server so it will always be up to date.
View 2 Replies
Jun 16, 2009
Is it possible to construct an vertical sliding thumbnails of images. The example is shown at following path: [URL]
View 1 Replies
Jan 22, 2009
I'm really trying to learn and construct a for loop in a practical, useful manner. I'm familiar with for loops, but I've never used one in a practical application. I understand the syntax.
[Code]...
View 7 Replies
Jun 13, 2011
I have been searching for a tutorial to teach me how to create a custom form. Unfortunately there are none. I've tried taking a few free forms I have found and customizing them but to no avail. Therefore, I have come to this fountain of knowledge to see if I can find what I am looking for. I want to fully understand how to construct the forms and the php file in the event I need to create different types of custom forms successfully. I need a form that has the name, email, phone number and of course the send button.
[Code]...
View 1 Replies