For a flash game i'm working on i would like to know if there is anything that can be done to stop players that pause the game by pausing the browser process as shown in this youtube video?
I'm already looking in to all the other great suggestions to avoid or at least slow down cheat engine hackers at : What is the best way to stop people hacking the PHP-based highscore table of a Flash game. But couldn't find anything on pausing processes.
Pausing a process is detectable by using (new Date()).getTime() repeatedly with short intervals. If, say, the difference between the dates exceeds several seconds, and you are querying this statement once per 30 frames, then either your framerate stalls or the process has been paused.
Related
recently, I find Chrome devTool have no Frame mate anymore, but Frame Rendering Stats, They are different panel. I can get real time FPS before, but now, it just show me how much Frame ploted and how much droped, and memory use. if I want FPS, must record preformance and analys it of write script to compute it.
so, is there any method to get real time FPS directly
Audio.AnalyserFreqBinCount("audio", 0)
My game is analyzing the audio levels so that music can affect the game behaviour.
How can I play audio a bit delayed, after it has been analyzed, now the analyzing occurs exactly same time when music is played.
Assuming you can access the Web Audio API via the framework, you could use the createDelay() to create a delay node. The delay is given in seconds.
Then simply:
Plug source into analyzer node as well as delay node.
Then connect delay node to destination
Process the data from analyzer node as usual.
I am trying to get the current playback time of the background music (since i want to synchronize game events with this sound track)
Would anyone happen to know how to achieve this?
I've found that for normal cocos2d it would be something as seen on this question:
How to play a BGM and know current playback time on in cocos2d ios?
And a possible solution for cocos2dx that I found:
What I have been doing so far is saving the clock time immediately
after starting playing the music, and then on each update I get the
current clock time and compare it to the saved clock time when the
music was started, giving me the time since the music was started.
As seen on this post: http://discuss.cocos2d-x.org/t/audio-syncing-simpleaudioengine-buffer-position/8488
But he mentions that it eventually gets out of synch (the longer the music plays)
Thanks.
I'm currently working on a dynamic MP3 player in AS3. The player will also support continuous (in length) radio streams.
Because my player will include a 'seek' bar, I allow the user to seek through the Sound object's data. Now I know that with a continuous stream, data being stored on the users RAM will never stop, as downloading will never stop on a continuous stream. This means, after a few hours of streaming, allot of RAM is being used by my app. I've tested the app on my own machine, running a very high spec, and the app crashes in my browser. When i say the app crashes, I mean the whole of Flash, meaning I have to restart my browser in order to use Flash again. I know my app is the cause as Flash has never crashed in the past. It only does it when my app has been streaming for 2+ hours.
So what I want to do is only allow the user to cache up to an hours worth of audio. After an hour, I want to clear the first half of the sound objects data, meaning that only the most recent half hours audio is stored and available for seeking.
So I have my stream:
var soundObj:Sound = new Sound();
soundObj.load(new URLRequest('stream.mp3'));
//ect ect
and sound is where the data is stored. So my question: How would I clear the first 30 mins of audio from that object?
Perhaps the Sound class is not meant to reliably play "unlimited" MP3 files, which seems to be your case. It is made to play normal MP3 "songs". Two hours of MP3 sound can easily accumulate to be larger than 200 megabytes of data.
But there is a good solution - use NetConnection and NetStream classes to stream audio instead. There are many tutorials out there. You will also be able to stream your MP3s, just a bit differently - a central server will be involved, which will transcode these MP3s on the fly, delivering it to you in a true "streaming" manner. One of such servers is Adobe Flash Media Server, an overpriced piece of work from Adobe. A lot of free and open-source alternatives exist which will work fine for your purposes - Red5, nginx-rtmp to name a few, that I have tested myself.
I've been working on a Flash script that allows the user to speak and playback what the user is saying after certain but exact time, say 10 seconds. That without sending anything to the sever, I've been asking around with no success about it. Is this simply impossible?
Yes this is possible, see here for an example of recording and then playing back the captured audio: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html#WS184831AF-B842-4d52-BFB9-D7601F4A9E21
The example above basically does exactly what you are looking for.