@@ -240,6 +240,48 @@ struct ProvidersResponse: Decodable {
240240 let available : Int
241241}
242242
243+ struct AudioDevice : Decodable , Identifiable {
244+ let id : Int
245+ let name : String
246+ let maxInputChannels : Int
247+ let maxOutputChannels : Int
248+ let defaultSamplerate : Double
249+ let isInput : Bool
250+ let isOutput : Bool
251+
252+ enum CodingKeys : String , CodingKey {
253+ case id
254+ case name
255+ case maxInputChannels = " max_input_channels "
256+ case maxOutputChannels = " max_output_channels "
257+ case defaultSamplerate = " default_samplerate "
258+ case isInput = " is_input "
259+ case isOutput = " is_output "
260+ }
261+ }
262+
263+ struct DevicesResponse : Decodable {
264+ let devices : [ AudioDevice ]
265+ let defaultInput : Int
266+ let defaultOutput : Int
267+ let currentInput : Int ?
268+ let currentOutput : Int ?
269+ let currentSampleRate : Int
270+ let currentFormat : String
271+ let currentBitDepth : Int
272+
273+ enum CodingKeys : String , CodingKey {
274+ case devices
275+ case defaultInput = " default_input "
276+ case defaultOutput = " default_output "
277+ case currentInput = " current_input "
278+ case currentOutput = " current_output "
279+ case currentSampleRate = " current_sample_rate "
280+ case currentFormat = " current_format "
281+ case currentBitDepth = " current_bit_depth "
282+ }
283+ }
284+
243285struct SoundRecord : Decodable , Identifiable {
244286 let id : String
245287 let createdAt : String
@@ -294,6 +336,77 @@ struct GeneratePayload: Encodable {
294336 }
295337}
296338
339+ struct StableAudioLoraPayload : Encodable {
340+ let name : String
341+ let path : String
342+ let strength : Double
343+ let interval : [ Double ] ?
344+ }
345+
346+ struct StableAudioRenderPayload : Encodable {
347+ let prompt : String
348+ let mode : String
349+ let duration : Double
350+ let provider : String
351+ let model : String
352+ let decoder : String
353+ let localProvider : String
354+ let localModel : String
355+ let serviceURL : String
356+ let chunkedDecode : Bool
357+ let sourceLayer : Int ?
358+ let targetLayer : String ?
359+ let assignLayer : Bool
360+ let tags : [ String ]
361+ let negativePrompt : String
362+ let seed : Int ?
363+ let steps : Int
364+ let cfgScale : Double
365+ let noiseDepth : Double ?
366+ let inpaintStart : Double ?
367+ let inpaintEnd : Double ?
368+ let variationCount : Int
369+ let loraStack : [ StableAudioLoraPayload ]
370+ let loraAPath : String
371+ let loraAStrength : Double
372+ let loraBPath : String
373+ let loraBStrength : Double
374+ let loraIntervalMin : Double
375+ let loraIntervalMax : Double
376+
377+ enum CodingKeys : String , CodingKey {
378+ case prompt
379+ case mode
380+ case duration
381+ case provider
382+ case model
383+ case decoder
384+ case localProvider = " local_provider "
385+ case localModel = " local_model "
386+ case serviceURL = " service_url "
387+ case chunkedDecode = " chunked_decode "
388+ case sourceLayer = " source_layer "
389+ case targetLayer = " target_layer "
390+ case assignLayer = " assign_layer "
391+ case tags
392+ case negativePrompt = " negative_prompt "
393+ case seed
394+ case steps
395+ case cfgScale = " cfg_scale "
396+ case noiseDepth = " noise_depth "
397+ case inpaintStart = " inpaint_start "
398+ case inpaintEnd = " inpaint_end "
399+ case variationCount = " variation_count "
400+ case loraStack = " lora_stack "
401+ case loraAPath = " lora_a_path "
402+ case loraAStrength = " lora_a_strength "
403+ case loraBPath = " lora_b_path "
404+ case loraBStrength = " lora_b_strength "
405+ case loraIntervalMin = " lora_interval_min "
406+ case loraIntervalMax = " lora_interval_max "
407+ }
408+ }
409+
297410struct GenerateResponse : Decodable {
298411 let status : String
299412 let sound : SoundRecord ?
0 commit comments