Playing sound using AVAudioPlayer in iPhone

by Deepak Dhakal 11. May 2009 12:34

Add a audio framwork AVFoundation using

#import and use code below to play a sound

 ########################### #########
AVAudioPlayer *myExampleSound;
NSString *myExamplePath = [[NSBundle mainBundle] pathForResource:@"horror" ofType:@"wav"];
myExampleSound =[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:myExamplePath] error:NULL];
myExampleSound.delegate = self;
[myExampleSound play]; //play sound
//[myExampleSound stop]; you can stop like this
###########################################################

When you add a AVFoundation framwork, make sure to use absolute path.. Relative path is by default there and that gives compile error ..

Tags:

General | iPhone

“content encoding error” while using blogengine.net

by Deepak Dhakal 11. May 2009 10:49

 

While using BlogEngine.net you may run into “content encoding error” “The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression” this error, to resolve this, find

<add name=”CompressionModule” type=”BlogEngine.Core.Web.HttpModules.CompressionModule, BlogEngine.Core”/>

in your web.config file and comment this line of code. This error mostly arrives when you host blogengine.net site on GoDaddy.

Tags:

Blogging | General

Powered by BlogEngine.NET 1.5.0.7 - Old School Theme by n3o Web Designers