Search found 542 matches

by Simon Knight
Tue Mar 24, 2020 12:15 pm
Forum: LiveCode Builder
Topic: How do I deal with Code Blocks?
Replies: 26
Views: 1867

Re: How do I deal with Code Blocks?

@LCMark Usually you would use this when an ObjC method returns an object with a reference already added (e.g. Alloc methods). Note: The Alloc method above should return ObjcRetainedId (IIRC) but the init method should take ObjcId and return ObjcId. So is it fair to say that except in exceptional cir...
by Simon Knight
Thu Mar 19, 2020 5:42 pm
Forum: LiveCode Builder
Topic: How do I deal with Code Blocks?
Replies: 26
Views: 1867

Re: How do I deal with Code Blocks?

Excellent news, now I have something to do while isolating at home.

Stay well

Simon
by Simon Knight
Sat Mar 14, 2020 12:14 pm
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Parsing arrays
Replies: 29
Views: 2500

Re: Parsing arrays

I even once opened a bug report due to my personal "temporary blindness"! :D Just the once - you are a marvel ! ;-) As to arrays I think that some of the LC examples are unnecessarily complicated: # declare the arrays we are going to populate local tLineArray1, tLineArray2, tArrayInArray # populate...
by Simon Knight
Sat Mar 14, 2020 11:25 am
Forum: Getting Started with LiveCode - Experienced Developers
Topic: Parsing arrays
Replies: 29
Views: 2500

Re: Parsing arrays

Hi and bump!

Just wanted to say that this thread helped clarify a few points about arrays - so thanks all.
by Simon Knight
Wed Feb 26, 2020 2:24 pm
Forum: Multimedia
Topic: Extracting jpeg thumbnail image from camera raw
Replies: 0
Views: 1376

Extracting jpeg thumbnail image from camera raw

Hi, I am writing a utility application to aid me in managing raw image files taken on a digital camera. I decided it would be useful to be able to view thumbnails of the images from within my application and the stack that is attached demonstrates one method of locating and extracting a jpeg from a ...
by Simon Knight
Mon Feb 24, 2020 1:47 pm
Forum: Talking LiveCode
Topic: If statement without end if - why does this work?
Replies: 15
Views: 1131

Re: If statement without end if - why does this work?

Being a bear of little brain I could not agree more, I'm all in favour of clear code over concise code especially if it helps avoid the "dangling else" issue. Re reading the dictionary, well o.k. reading all the way to the end of the entry reveals this: If one if control structure is nested inside a...
by Simon Knight
Mon Feb 24, 2020 10:06 am
Forum: Talking LiveCode
Topic: If statement without end if - why does this work?
Replies: 15
Views: 1131

Re: If statement without end if - why does this work?

Thanks Richard,

I always thought that once the statement was multi line it had to be closed with an end so you live and learn. I can't decide if the form above is an aid or hinderance to understanding code.
by Simon Knight
Mon Feb 24, 2020 9:35 am
Forum: Talking LiveCode
Topic: If statement without end if - why does this work?
Replies: 15
Views: 1131

If statement without end if - why does this work?

Hi, I am using some code that Scott Rossi published and I would like to understand why it does not throw an error : command updateMyValue local theRange, thePercent, theAmount, theStartValue local theArcValue, local tGuageValue, tStartValue, tEndValue lock screen put abs(myEndValue() - myStartValue(...
by Simon Knight
Tue Feb 18, 2020 10:14 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

Hi Paul, Also, with Objective C FFI and creating global objects there is some situations where you want 'ObjCRetainedId' instead of the regular 'ObjCId'. This is somewhat of a mystery to me, Its a mystery to me as well and I am mostly following the same "suck it and see" policy! I think I read that ...
by Simon Knight
Tue Feb 18, 2020 10:03 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

After some hours of head scratching here is an update to the library: library net.anvic.skids.speechsynth use com.livecode.foreign use com.livecode.objc metadata title is "Speech Synth Library" metadata author is "Simon (Skids) Knight" metadata version is "1.0.0" -- bind the memory allocation handle...
by Simon Knight
Tue Feb 18, 2020 8:09 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

The next step is to obtain a voice based on a name passed in from Livecode Script (LCS). This will use handlers very much like those just created. It would be useful to know if the array of voices is destroyed once the LCB handler that uses it completes. If, as I suspect it is then the LCB variable ...
by Simon Knight
Tue Feb 18, 2020 8:03 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

Here is some progress using the following handlers: code: -- return a list of voices in an array of AVSpeechSynthesisVoice objects private foreign handler ObjC_AVSpeechSynthesisVoices() \ returns ObjcID \ binds to "objc:AVFoundation>AVSpeechSynthesisVoice.+speechVoices" private foreign handler Objc_...
by Simon Knight
Tue Feb 18, 2020 12:57 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

So the first step is revealed here : https://developer.apple.com/documentation/avfoundation/avspeechsynthesisvoice?language=objc#1668668 To select a voice for use in speech, obtain an AVSpeechSynthesisVoice instance using one of the methods in Finding Voices, and then set it as the value of the voic...
by Simon Knight
Tue Feb 18, 2020 12:41 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

For clarity here is the complete working yet unfinished library that I started : library net.anvic.skids.speechsynth use com.livecode.foreign use com.livecode.objc metadata title is "Speech Synth Library" metadata author is "Simon (Skids) Knight" metadata version is "1.0.0" -- bind the memory alloca...
by Simon Knight
Tue Feb 18, 2020 12:32 pm
Forum: LiveCode Builder
Topic: Text-to-speech TTS for iOS
Replies: 17
Views: 1458

Re: Text-to-speech TTS for iOS

ooops I misread your post and my own code.... So with this code : unsafe -- convert the string passed into a NSString object put StringToNSString(pText) into tTextToSpeak -- create instance of SpeechSynth put ObjC_AVSpeechSynthAlloc() into tSpeechSynth put ObjC_AVSpeechSynthInit(tSpeechSynth) into t...

Go to advanced search