How do you archive mixed objects that conforms to NSSecureCoding (SFTranscription) for later retrieval?
I am utilizing SFSpeechRecognizer and attempting to save the results of the transcription for later analysis and processing. My issue isnt specifically with speech but rather with archiving.
Unfortunately, I haven't archived before and after Googling, I have encountered challenges.
Type 'TranscriptionResults' does not conform to protocol 'Decodable'
Type 'TranscriptionResults' does not conform to protocol 'Encodable'
When I add the SFTranscription type with " var transcription : SFTranscription" I get the above error
I looked it up and SFTranscription is the following
open class SFTranscription : NSObject, NSCopying, NSSecureCoding {...}
SFTranscription is my issue is with complying with Codable, as it doe not look like you can mix with NSSecureCoding.
I don't think my issue is specifically with SFTranscription but understanding how to save the results that include a mix of NSSecureCoding to disk.
How do you save the result for later retrieval?
I am utilizing SFSpeechRecognizer and attempting to save the results of the transcription for later analysis and processing. My issue isnt specifically with speech but rather with archiving.
Unfortunately, I haven't archived before and after Googling, I have encountered challenges.
Code Block struct TranscriptionResults: Codable { var currTime : Double // Running start time from beginning of file var currSegStart : Double // start from beginning of segment var currSegSecs : Double // segment length in seconds var currSegEnd : Double // end = currStart + segmentSecs, calculate dont need to save var elapsedTime : Double // how much time to process to this point var fileName : String var fileURL : URL var fileLength : Int64 var transcription : SFTranscription //* does not conform to Codable ** }
Type 'TranscriptionResults' does not conform to protocol 'Decodable'
Type 'TranscriptionResults' does not conform to protocol 'Encodable'
When I add the SFTranscription type with " var transcription : SFTranscription" I get the above error
I looked it up and SFTranscription is the following
open class SFTranscription : NSObject, NSCopying, NSSecureCoding {...}
SFTranscription is my issue is with complying with Codable, as it doe not look like you can mix with NSSecureCoding.
I don't think my issue is specifically with SFTranscription but understanding how to save the results that include a mix of NSSecureCoding to disk.
How do you save the result for later retrieval?