Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-02-2011, 06:25 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Melbourne, Australia
Age: 29
Posts: 9
narconate is on a distinguished road
Default AVAudio change with UILabel

Hi im working on an app at the moment and not sure how to do this but I would like a UIButton to play an audio file - but for the Audio file to be different depending on what a UILabel displays.
I have one UILabel and several UIButtons - when the UIButton is pressed it changes the text of the UILabel - i would like to create another UIButton that will play the audio file that says "this is red" when the text in the UILabel shows the text "red".Its an app im working on for hearing impaired

I appreciate any help that can be given

Nathan
narconate is offline   Reply With Quote
Old 11-03-2011, 04:50 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: Melbourne, Australia
Age: 29
Posts: 9
narconate is on a distinguished road
Question

Still spending long hours trying to work out whats wrong here:
I have input the following code, and attached it to a button in the interface:

Code:
- (IBAction)wordsoundbutton:(id)sender {
    if (wordlabel.text == @"red") {
        NSString *path = [[NSBundle mainBundle]pathForResource:@"test" ofType:@"mp3"];
        AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath: path] error:NULL];
        theAudio.delegate = self;
        [theAudio play];
        
    }
}
When i click the button when the UILabel says "red" it comes up with the following message:

Code:
2011-11-03 20:42:13.389 hearingpad[24920:10703] Error loading /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn:  dlopen(/System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn, 262): Symbol not found: ___CFObjCIsCollectable
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation
 in /System/Library/Frameworks/Security.framework/Versions/A/Security
Terminating in response to SpringBoard's termination.
Program ended with exit code: 0

grateful for support thanks
narconate is offline   Reply With Quote
Reply

Bookmarks

Tags
avaudio, uilabel

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 399
12 members and 387 guests
7twenty7, buggen, EvilElf, guusleijsten, j.b.rajesh@gmail.com, LunarMoon, morterbaher, QuantumDoja, sacha1996, Sami Gh, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,673
Threads: 94,122
Posts: 402,906
Top Poster: BrianSlick (7,990)
Welcome to our newest member, morterbaher
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 05:32 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0