Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unwanted sound effects



Not sure If I understand the problem exactly, but maybe this method treats each write as an independent file copy and thats why the sound gets played each time? And maybe there is a way to disable the sound and re-enable afterwards?

Hope this helps.

-Michael
On May 30, 2008, at 3:03 PM, Joshua Whalen wrote:

Hello again.

Weird behavior in my app. 

While writing to disk using this subroutine:

on write_to_file(this_data, target_file, append_data) -- one of Apple's essentail subroutines sample codes
try
set the target_file to the target_file as text
set the open_target_file to ¬
open for access file target_file with write permission
if append_data is false then ¬
set eof of the open_target_file to 0
write this_data to the open_target_file as «class utf8» starting at eof
close access the open_target_file
return true
on error
try
close access file target_file
end try
return false
end try
end write_to_file


the app plays the system sound on each write (it does several hundred writes on a typical save), even though I have user interface sounds disabled in the sound prefs dialog. 

This is disastrous, since the program is meant to be used on an internet radio broadcast host, and the sounds will be broadcast. It's a definite deal killer. I've tested this on 3 different machines, an old Pismo, a 1GZ 17" pbook, and a mac mini with a core duo. The first two are running tiger, the mini is running leopard. The two pbooks are using an xcode 2.4.1
build, the mini a leopard build. 

Is there something I should know about disk writes? or progress bars? 

Here's my save dialog subroutine:

on DisplaySaveStatus(mystatus, myprogress, startprogress)
if startprogress = "go" then
display panel window "status" attached to window "main"
set content of text field 1 of window "status" to mystatus
set content of text field 2 of window "status" to myprogress
start progress indicator "progress" of window "status"
else
if startprogress = "stop" then
set content of text field 1 of window "status" to mystatus
set content of text field 2 of window "status" to myprogress
close panel window "status"
stop progress indicator "progress" of window "status"
end if
end if
end DisplaySaveStatus


Joshua Whalen
+1-212-931-9812 - home, voicemail
+1-747-665-1905 - SIP

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Studio mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/applescript-studio/email@hidden

This email sent to email@hidden

References: 
 >unwanted sound effects (From: Joshua Whalen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.