]> OzVa Git service - spaceweather/commitdiff
fixed quotes in spaceweather.py
authorwill <greenwoodw50@gmail.com>
Sun, 19 May 2024 19:52:53 +0000 (20:52 +0100)
committerwill <greenwoodw50@gmail.com>
Sun, 19 May 2024 19:52:53 +0000 (20:52 +0100)
spaceweather.py

index e17c597b471410b08cd73bdf38c49633d558cbe7..ac051113aaae6aec4aad447344af0b9d2196baa5 100755 (executable)
@@ -52,7 +52,7 @@ def generate_bed(duration):
                #position the data and normalize
                source["data"] += source["min"]
                smooth = source["data"]
-               print(f"{i} -> average: {np.mean(source["data"])} min: {np.min(source["data"])} max: {np.max(source["data"])}")
+               print(f"{i} -> average: {np.mean(source['data'])} min: {np.min(source['data'])} max: {np.max(source['data'])}")
                source["data"] = np.round(source["data"])
 
                # plot the data
@@ -73,7 +73,7 @@ def generate_bed(duration):
                                        (f"synth {sr}s " # call effect and duration
                                        f"{source['type']} " # sets the type of synth eg:sine
                                        f"%{round(source['data'][p])} "
-                                       f"gain {source["gain"]}\n") # sets the frequency
+                                       f"gain {source['gain']}\n") # sets the frequency
                                        # f"{source['data'][p]}/{source['data'][p+1]} norm -12\n") # could be used for a linier sweep of frequencys
                                )
 
@@ -172,7 +172,7 @@ def generate_html(transcript):
        graph_html = "<div class='figures'>" + "".join([f"<img src='media/graph.{i}.png' alt='graph'>" for i in range(len(data))]) + "</div>"
 
        refs_html = "".join([
-               f"<p id='ref{i+refs}'><em>[{i+refs}] {data[i]["realname"]}. <a href='{data[i]["url"]}'>{data[i]["url"]}</a></em></p>" for i in range(len(data))
+               f"<p id='ref{i+refs}'><em>[{i+refs}] {data[i]['realname']}. <a href='{data[i]['url']}'>{data[i]['url']}</a></em></p>" for i in range(len(data))
                ])
 
        template.insert(1, graph_html)
@@ -223,7 +223,7 @@ print(f"duration: {round(duration, 2)} padding: {padding}")
 # pipe reccursion to join all the audio clips together
 call = f"sox {order[1]["file"]} -p pad 0 {padding}|"
 for clip in order[2:-2]:
-       call += f"sox - {clip["file"]} -p pad 0 {padding}|"
+       call += f"sox - {clip['file']} -p pad 0 {padding}|"
 call += f"sox --effects-file=config/voice.effects - audio/voice.wav"
 os.system(call)
 
@@ -232,7 +232,7 @@ generate_bed(get_duration("audio/voice.wav"))
 
 # generate the full report
 print("finalizing...")
-os.system(f"sox --effects-file=config/voice.effects {order[-1]["file"]} audio/last.wav")
+os.system(f"sox --effects-file=config/voice.effects {order[-1]['file']} audio/last.wav")
 os.system(f"sox --combine mix-power audio/voice.wav audio/bed.wav audio/body.wav")
 os.system(f"sox --effects-file=config/master.effects audio/start.wav audio/body.wav audio/end.wav audio/last.wav spaceweather.wav")
 print("generated spaceweather!")