Sound Analysis

RSS for tag

Analyze streamed and file-based audio to classify it as a particular type using Sound Analysis.

Posts under Sound Analysis tag

31 Posts

Post

Replies

Boosts

Views

Activity

Unexpected results from SNClassifySoundRequest
I'm seeing unexpected results when examining the results from a sound classification test. Whilst I appear to get accurate startTime for observations, the duration is always the same as the value put into the windowDuration. I'm guessing I'm misunderstanding the purpose of duration in the classification results. The link here says: The time range’s CMTime values are the number of audio frames at the analyzer’s sample rate. Use these time indices to determine where, in time, the result corresponds to the original audio. My understanding of this statement is it should give me the startTime AND the duration of that detection event. For example, if I attempt to detect a crowd sound and that sound lasts for 1.8 seconds, then I should see 1.8 seconds in the duration. Below is some code showing what I'm seeing. Initialisation of request.windDuration of 1 second. If I change this to any other value, that value is reported back as the duration of the event. Even if the event is half a second in duration. Any help in either a code issue or understanding the results better would be appreciated. Thanks let request = try SNClassifySoundRequest(classifierIdentifier: .version1) request.overlapFactor = 0.8 request.windowDuration = CMTimeMakeWithSeconds(600, preferredTimescale: 600) My code to get the values out of the SNResult func request(_ request: SNRequest, didProduce result: SNResult) { guard let analysisResult = result as? SNClassificationResult, let predominantSound = analysisResult.classifications.first?.identifier, soundsToDetect.contains(predominantSound) else { return } let startTime = analysisResult.timeRange.start.seconds let duration = analysisResult.timeRange.duration.seconds let confidence = analysisResult.classifications.first?.confidence ?? 0.0 let detectedSound = ClassificationObject(id: UUID(), name: predominantSound, startTime: startTime, duration: duration, confidence: confidence) self.detectedSounds.append(detectedSound) }
0
0
1.4k
Apr ’23
Analysis of podcast audio features
Hello! I am working on the final thesis of my Bachelor Degree, and I would like to focus on podcasts. I found an interesting dataset on Kaggle which includes reviews of iTunes podcasts and the link to the podcast. I would be interested in analysing the audio tracks to extract some features like pitch and intensity. The number of links is about 10,000. Is there any tool I could use to extract such features from the tracks? Thank you very much for your time :)
1
0
1.6k
Feb ’23
Sound output of apple devices
Hi, We are developing a hearing test that runs on apple devices. As part of the process of getting our product certified risk factors are to be assessed. One risk factor can be that the device malfunction and sends a sound (constant high) that ultimately damages the test persons hearing. Is anyone familiar with the hight possible output of sound (in dB) from apple devices?
2
0
1.5k
Oct ’22
Sound decibel recognition
Hi Community Members, We tried to find the particular sound through the microphone. We used PKCCheck to detect the sound decibel. we detect the sound based on the number of dB values per second we receive and add some logic over it to get the result, but when we have continuous sound like an alarm we can't detect it as the gap between the sound is very less. Any suggestion on libraries to achieve this. Also whether we can achieve this thru Frequency & Amplitude method. Please advise.
0
0
1.5k
Oct ’22
iOS app crashes when running this code
This code crashed when running startApplianceListener() when using onAppear() on a swiftui view import AVFAudio import CoreML import SoundAnalysis /// An observer that receives results from a classify sound request. class ResultsObserver: NSObject, SNResultsObserving {     /// Notifies the observer when a request generates a prediction.     func request(_ request: SNRequest, didProduce result: SNResult) {         // Downcast the result to a classification result.         guard let result = result as? SNClassificationResult else  { return }         // Get the prediction with the highest confidence.         guard let classification = result.classifications.first else { return }         // Get the starting time.         let timeInSeconds = result.timeRange.start.seconds         // Convert the time to a human-readable string.         let formattedTime = String(format: "%.2f", timeInSeconds)         print("Analysis result for audio at time: \(formattedTime)")         // Convert the confidence to a percentage string.         let percent = classification.confidence * 100.0         let percentString = String(format: "%.2f%%", percent)         // Print the classification's name (label) with its confidence.         print("\(classification.identifier): \(percentString) confidence.\n")     }     /// Notifies the observer when a request generates an error.     func request(_ request: SNRequest, didFailWithError error: Error) {         print("The the analysis failed: \(error.localizedDescription)")     }     /// Notifies the observer when a request is complete.     func requestDidComplete(_ request: SNRequest) {         print("The request completed successfully!")     } } func startApplianceListener() {     do {         var audioEngine: AVAudioEngine?         var inputBus: Int?         var inputFormat: AVAudioFormat?         var streamAnalyzer: SNAudioStreamAnalyzer         func startAudioEngine() {             audioEngine = AVAudioEngine()                          inputBus = AVAudioNodeBus(0)             inputFormat = audioEngine!.inputNode.inputFormat(forBus: inputBus!)             do {                 try audioEngine!.start()             } catch {                 print("Unable to start AVAudioEngine \(error.localizedDescription)")                 exit(1)             }         }         startAudioEngine()         streamAnalyzer = SNAudioStreamAnalyzer(format: inputFormat!)         let version1 = SNClassifierIdentifier.version1         let request = try SNClassifySoundRequest(classifierIdentifier: version1)         let resultsObserver = ResultsObserver()         try streamAnalyzer.add(request,                                withObserver: resultsObserver)         func installAudioTap() {             audioEngine!.inputNode.installTap(onBus: inputBus!,                                               bufferSize: 8192,                                               format: inputFormat,                                               block: analyzeAudio(buffer:at:))         }         let analysisQueue = DispatchQueue(label: "dev.paulwalker.AnalysisQueue")         func analyzeAudio(buffer: AVAudioBuffer, at time: AVAudioTime) {             analysisQueue.async {                 streamAnalyzer.analyze(buffer,                                        atAudioFramePosition: time.sampleTime)             }         }         installAudioTap()     } catch {} }
1
0
1.3k
Mar ’22
How to convert audio-files from smrc-format to playable format?
I have to process interviews, recorded on iphone and sent to me in smrc-format. I have been unable to find a file-converter able to read smrc and convert to mp3 or comparable. Is there a way to make these files audible? The header of one of these files starts like this: bplist00‘ ûüX$versionX$objectsY$archiverT$top � Ü†Ø ( $%&-89:;<=>IMPSVY_bepsvy| äçêìñóòôùU$null“ V$classZNS.objectsÄ ´ Help would be greatly appreciated, the interviews cannot be done again.
0
0
1.1k
Mar ’22
Unexpected results from SNClassifySoundRequest
I'm seeing unexpected results when examining the results from a sound classification test. Whilst I appear to get accurate startTime for observations, the duration is always the same as the value put into the windowDuration. I'm guessing I'm misunderstanding the purpose of duration in the classification results. The link here says: The time range’s CMTime values are the number of audio frames at the analyzer’s sample rate. Use these time indices to determine where, in time, the result corresponds to the original audio. My understanding of this statement is it should give me the startTime AND the duration of that detection event. For example, if I attempt to detect a crowd sound and that sound lasts for 1.8 seconds, then I should see 1.8 seconds in the duration. Below is some code showing what I'm seeing. Initialisation of request.windDuration of 1 second. If I change this to any other value, that value is reported back as the duration of the event. Even if the event is half a second in duration. Any help in either a code issue or understanding the results better would be appreciated. Thanks let request = try SNClassifySoundRequest(classifierIdentifier: .version1) request.overlapFactor = 0.8 request.windowDuration = CMTimeMakeWithSeconds(600, preferredTimescale: 600) My code to get the values out of the SNResult func request(_ request: SNRequest, didProduce result: SNResult) { guard let analysisResult = result as? SNClassificationResult, let predominantSound = analysisResult.classifications.first?.identifier, soundsToDetect.contains(predominantSound) else { return } let startTime = analysisResult.timeRange.start.seconds let duration = analysisResult.timeRange.duration.seconds let confidence = analysisResult.classifications.first?.confidence ?? 0.0 let detectedSound = ClassificationObject(id: UUID(), name: predominantSound, startTime: startTime, duration: duration, confidence: confidence) self.detectedSounds.append(detectedSound) }
Replies
0
Boosts
0
Views
1.4k
Activity
Apr ’23
Analysis of podcast audio features
Hello! I am working on the final thesis of my Bachelor Degree, and I would like to focus on podcasts. I found an interesting dataset on Kaggle which includes reviews of iTunes podcasts and the link to the podcast. I would be interested in analysing the audio tracks to extract some features like pitch and intensity. The number of links is about 10,000. Is there any tool I could use to extract such features from the tracks? Thank you very much for your time :)
Replies
1
Boosts
0
Views
1.6k
Activity
Feb ’23
Sound output of apple devices
Hi, We are developing a hearing test that runs on apple devices. As part of the process of getting our product certified risk factors are to be assessed. One risk factor can be that the device malfunction and sends a sound (constant high) that ultimately damages the test persons hearing. Is anyone familiar with the hight possible output of sound (in dB) from apple devices?
Replies
2
Boosts
0
Views
1.5k
Activity
Oct ’22
Sound decibel recognition
Hi Community Members, We tried to find the particular sound through the microphone. We used PKCCheck to detect the sound decibel. we detect the sound based on the number of dB values per second we receive and add some logic over it to get the result, but when we have continuous sound like an alarm we can't detect it as the gap between the sound is very less. Any suggestion on libraries to achieve this. Also whether we can achieve this thru Frequency & Amplitude method. Please advise.
Replies
0
Boosts
0
Views
1.5k
Activity
Oct ’22
iOS app crashes when running this code
This code crashed when running startApplianceListener() when using onAppear() on a swiftui view import AVFAudio import CoreML import SoundAnalysis /// An observer that receives results from a classify sound request. class ResultsObserver: NSObject, SNResultsObserving {     /// Notifies the observer when a request generates a prediction.     func request(_ request: SNRequest, didProduce result: SNResult) {         // Downcast the result to a classification result.         guard let result = result as? SNClassificationResult else  { return }         // Get the prediction with the highest confidence.         guard let classification = result.classifications.first else { return }         // Get the starting time.         let timeInSeconds = result.timeRange.start.seconds         // Convert the time to a human-readable string.         let formattedTime = String(format: "%.2f", timeInSeconds)         print("Analysis result for audio at time: \(formattedTime)")         // Convert the confidence to a percentage string.         let percent = classification.confidence * 100.0         let percentString = String(format: "%.2f%%", percent)         // Print the classification's name (label) with its confidence.         print("\(classification.identifier): \(percentString) confidence.\n")     }     /// Notifies the observer when a request generates an error.     func request(_ request: SNRequest, didFailWithError error: Error) {         print("The the analysis failed: \(error.localizedDescription)")     }     /// Notifies the observer when a request is complete.     func requestDidComplete(_ request: SNRequest) {         print("The request completed successfully!")     } } func startApplianceListener() {     do {         var audioEngine: AVAudioEngine?         var inputBus: Int?         var inputFormat: AVAudioFormat?         var streamAnalyzer: SNAudioStreamAnalyzer         func startAudioEngine() {             audioEngine = AVAudioEngine()                          inputBus = AVAudioNodeBus(0)             inputFormat = audioEngine!.inputNode.inputFormat(forBus: inputBus!)             do {                 try audioEngine!.start()             } catch {                 print("Unable to start AVAudioEngine \(error.localizedDescription)")                 exit(1)             }         }         startAudioEngine()         streamAnalyzer = SNAudioStreamAnalyzer(format: inputFormat!)         let version1 = SNClassifierIdentifier.version1         let request = try SNClassifySoundRequest(classifierIdentifier: version1)         let resultsObserver = ResultsObserver()         try streamAnalyzer.add(request,                                withObserver: resultsObserver)         func installAudioTap() {             audioEngine!.inputNode.installTap(onBus: inputBus!,                                               bufferSize: 8192,                                               format: inputFormat,                                               block: analyzeAudio(buffer:at:))         }         let analysisQueue = DispatchQueue(label: "dev.paulwalker.AnalysisQueue")         func analyzeAudio(buffer: AVAudioBuffer, at time: AVAudioTime) {             analysisQueue.async {                 streamAnalyzer.analyze(buffer,                                        atAudioFramePosition: time.sampleTime)             }         }         installAudioTap()     } catch {} }
Replies
1
Boosts
0
Views
1.3k
Activity
Mar ’22
How to convert audio-files from smrc-format to playable format?
I have to process interviews, recorded on iphone and sent to me in smrc-format. I have been unable to find a file-converter able to read smrc and convert to mp3 or comparable. Is there a way to make these files audible? The header of one of these files starts like this: bplist00‘ ûüX$versionX$objectsY$archiverT$top � Ü†Ø ( $%&-89:;<=>IMPSVY_bepsvy| äçêìñóòôùU$null“ V$classZNS.objectsÄ ´ Help would be greatly appreciated, the interviews cannot be done again.
Replies
0
Boosts
0
Views
1.1k
Activity
Mar ’22