I have my audio file in MyProjectName_data\resources\Sounds\ but after btn click alert:"finished". play doas not starts.I am working on android
function page1_btn_OnPressed(e) {
SMF.Multimedia.playSound("myaudio.mp3",
true,false,
function(){alert("started to play...");},
function(){alert("finished...");});
}
There is a known issue about playing audio files.
It will be fixed in the upcoming releases of Smartface.
Related
When using unity 2017.1 Video is played with sound. And audio without a video also played well.
When I upgrade to unity 2017.3 video is played without sound, while audio file without video is played well (sound is on).
Edit:
When building the application to windows sound is working.
The problem seems to appear only in editor.
After sending a bug to unity, they respond after a long time.
The solution was adding this line when assigning the Audio from Video to AudioSource to be played.
private VideoPlayer _videoPlayer;
.
.
.
.
.
//Assign the Audio from Video to AudioSource to be played
_videoPlayer.controlledAudioTrackCount = 1; // <-- We have added this line. It tells video player that you will have one audio track playing in Unity AudioSource.
_videoPlayer.EnableAudioTrack(0, true);
_videoPlayer.SetTargetAudioSource(0, _audioSource);
But still don't know why it is working without this line on previous versions (2017.2 for example)? and why it is also working without this line on exe build?
I am developing a tvml/tvjs application and I have added the following code to allow audio to play in the background (applicationDidBecomeActive):
let audioSession = AVAudioSession.sharedInstance()
do {
try audioSession.setCategory(AVAudioSessionCategoryPlayback)
try audioSession.setActive(true)
} catch {
print("no audio to assign")
}
I also set the first item in Required Background Modes in info.plist to App plays audio or streams audio/video using AirPlay.
My problem now is that although I can play audio in the background and pause the audio from anywhere in tvOS, I cannot play the audio after pausing. I am looking for the functionality like the Podcast app where I can freely play and pause the current streaming audio.
I cannot seem to find anything in the documentation for TVML/TVJS that points me in the right direction. Thanks!
I have developed a sencha-phonegap application which comprise of playing videos already present in the application.
When I play any other video such as a video song through the native player, audio is heard perfectly from the stereo speakers present at the bottom.
I am simply using the xtype: video tag to play the video. Here's my code to play the video:
{
xtype : 'video',
x : 0,
y : 0,
left :'0px',
top :'0px',
width : 175px,
height : 98px,
url : "path of video"
posterUrl: 'placeholder.png'
}
The problem which I am facing is that whenever the video is played, it only plays with sound when the earphones are connected and sometimes the audio can also be heard from the top-speaker (the speaker used during calls).
I have checked for the ringer and volume controls. Everything is at maximum.
My app supports iOS versions 5.0 and above.
Could this be iOS related issue?
Kindly provide some direction.
Thanx
Please first add Audio Toolbox and AVFoundation frameworks if not added already and than import class in which you add the below lines on app launch
#import<AVFoundation/AVFoundation.h>
than add these two lines in your project when you app launches
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,sizeof (audioRouteOverride),&audioRouteOverride);
May be it will work now.
On one of sencha forum, I found This Link Which Helped Me.
Since, it only specifically mentions about ringer off scenario, it also mentions in generic way that we need to add playback method for sound to work.
Cheers |m|
Which Audio Player is this??
I want to add the Above player in my iPhone App
How Can I include it to my App ?
and I want to play Audio files from server (without downloading) so how can I achive that?
http://iphoneincubator.com/blog/audio-video/simple-way-to-play-mp3-audio-files
http://cocoawithlove.com/2009/06/revisiting-old-post-streaming-and.html
http://cocoawithlove.com/2008/09/streaming-and-playing-live-mp3-stream.html
He's got a project linked from that page - http://projectswithlove.com/projects/iPhoneStreamingPlayer.zip
this is a custom made player. check out this project https://github.com/jfricker/AudioStreamer/
you just need to design similar interface.
I want to know if it's possible to play Ogg Vorbis audio file with iPhone SDK or if exist a library or a framework that allow this.
I've read something about OpenAL but I don't find any tutorial...
Can anyone help me??
Better late than never ;)
I have found the answer here Use cocos2d for playing ogg file in my project?.
PASoundMgr is a different sound engine that had support for ogg file
playback. However, it hasn't been updated since iOS 2.x and there are
numerous issues that have cropped up since then that it doesn't
handle.
Why do you need to play ogg files? If you convert them to aac you will
be able to play them back using hardware decoding which is much more
efficient from a cpu usage point of view.
They mentioned PASoundMgr. It worked for me. I just copied from cocos2d framework all files->libraries that SoundEngineTest was based on. And got rid of unnecessary code.
Here is my demoProject that shows how to play ogg on ios.
Be careful with iOS 5.* simulators, they have some problems with sound library. My demo works on 4.3 simulator and on Device.
Here are steps that I made to create demo:
First you will need cocos2d-iphone framework. I've already had it, but you can find it here cocos-2d_download.
As you can notice SoundEngineTest depends on libvorbis.a. It's a library that made of files from external/Tremor group. Also it depends on OpenAl, AudioToolbox frameworks.
I copied all files from tremor group to my project. Crearted "vorbis" Cocoa Touch Static Library, without ARC. And added all source files and header to the "vorbis" target in Build Phases tab.
In the Build Phases of OggPlayDemo Added libraries (libvorbis, OpenAl, AudioToolbox) to the Link Binary with Libraries box.
Added PA classes to project. And checked OggPlayDemo as a target. To avoid problems with ARC, I disabled ARC compilation for this 3 PA files. (see disable ARC for single file)
Removed all cocos2d references. There were some code related to correcting position of listener depending on orientation... I commented it. I don't need this feature for just playing audio.
Copied audio file.
And finally added this code to ViewController:
- (void)viewDidLoad
{
[super viewDidLoad];
//init
[PASoundMgr sharedSoundManager];
[[[PASoundMgr sharedSoundManager] listener] setPosition:CGPointMake(0, 0)];
self.audioSource = [[PASoundMgr sharedSoundManager] addSound:#"trance-loop" withExtension:#"ogg" position:CGPointMake(0, 0) looped:YES];
// lower music track volume and play it
[self.audioSource setGain:0.5f];
}
- (IBAction)play:(id)sender {
[self.audioSource playAtListenerPosition];
}
Cricket Audio will play ogg files, among others, and works on iOS/Android/WP8.