• Best of luck to the class of 2025 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here

Class of 2025 (2025 HSC CHAT) (15 Viewers)

Tony Stark

Well-Known Member
Joined
Jan 22, 2025
Messages
408
Location
Where th4run is
Gender
Male
HSC
2025
Patched together with bubblegum and popsicle sticks, found across the web
CHANNELS variable might have to be changed to match the device number connected to the computer
Python:
import pyaudio # Soundcard audio I/O access library
import wave # Python 3 module for reading / writing simple .wav files
import speech_recognition as sr
import requests
import time
from googlesearch import search
# import pyttsx3


def speech_search():
    # Setup channel info
    FORMAT = pyaudio.paInt16 # data type formate
    CHANNELS = 1 # Adjust to your number of channels
    RATE = 44100 # Sample Rate
    CHUNK = 1024 # Block Size
    RECORD_SECONDS = 5 # Record time
    WAVE_OUTPUT_FILENAME = "temp.wav"
    # Startup pyaudio instance
    audio = pyaudio.PyAudio()
    # start Recording
    stream = audio.open(format=FORMAT, channels=CHANNELS,
                    rate=RATE, input=True,
                    frames_per_buffer=CHUNK)
    # for x in range(10):
    #     if x <= 3:
    #         print(f'\r Recording{'.'*x}', end="\r")
    #     elif x % 2 and not x % 4 and x > 3:
    #         print(f'\r Recording..', end='\r')
    #     elif x > 3 and x % 4 and x % 2:
    #         print(f'\r Recording.', end='\r')
    #     else:
    #         print('\r Recording...', end='\r')
    print('Recording...')
    frames = []

    # Record for RECORD_SECONDS
    for i in range(0, int(RATE / CHUNK * RECORD_SECONDS)):
        data = stream.read(CHUNK)
        frames.append(data)
    print("Finished recording")


    # Stop Recording
    stream.stop_stream()
    stream.close()
    audio.terminate()

    # Write your new .wav file with built in Python 3 Wave module
    waveFile = wave.open(WAVE_OUTPUT_FILENAME, 'wb')
    waveFile.setnchannels(CHANNELS)
    waveFile.setsampwidth(audio.get_sample_size(FORMAT))
    waveFile.setframerate(RATE)
    waveFile.writeframes(b''.join(frames))
    waveFile.close()
    r = sr.Recognizer()


    base_url = "https://api.assemblyai.com"
    headers = {
        "authorization": "HELL NAW FIND YOUR OWN KEY"
    }
    # You can upload a local file using the following code
    with open("temp.wav", "rb") as f:
        response = requests.post(base_url + "/v2/upload",
                                headers=headers,
                                data=f)
    audio_url = response.json()["upload_url"]
    data = {
        "audio_url": audio_url,
        "speech_model": "universal"
    }

    url = base_url + "/v2/transcript"
    response = requests.post(url, json=data, headers=headers)
    transcript_id = response.json()['id']
    polling_endpoint = base_url + "/v2/transcript/" + transcript_id
    while True:
        transcription_result = requests.get(polling_endpoint, headers=headers).json()
        transcript_text = transcription_result['text']
        if transcription_result['status'] == 'completed':
            print(f"Transcript Text:", transcript_text)
            break
        elif transcription_result['status'] == 'error':
            raise RuntimeError(f"Transcription failed: {transcription_result['error']}")
        else:
            time.sleep(3)
    query_var = transcript_text
    for j in search(query_var, num_results=10):
        print(j)
    API_URL = "https://router.huggingface.co/hf-inference/models/Qwen/Qwen3-235B-A22B/v1/chat/completions"
    headers = {
        "Authorization": "Bearer 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",
    }

    def query(payload):
        response = requests.post(API_URL, headers=headers, json=payload)
        return response.json()

    response = query({
        "messages": [
            {
                "role": "user",
                "content": query_var
            }
        ],
        "max_tokens": 512,
        "model": "llama-3.3-70b"
    })
    #print(response["choices"][0]["message"])
    #return_text = response["choices"][0]["message"]["content"]
    print(response)
    print('done')
    url = f"https://translate.google.com/translate_tts?ie=UTF-8&client=tw-ob&q={query_var}&tl=en"
    response = requests.get(url)
    with open("output.mp3", "wb") as f:
        f.write(response.content)
    # engine = pyttsx3.init()
    # engine.say(response)
    # engine.runAndWait()

speech_search()
 

svad

Batman
Joined
Aug 2, 2024
Messages
497
Location
📍Gotham city
Gender
Female
HSC
2025
i meant like a not enough of a symbolic interpretation
yeah i dont think just quotes will cut it. The entire point of the mod is to know why good writing is considered 'good writing' and thats done through its use of language and techniques to send a message.
 

alphxreturns

Unknown Member
Joined
Oct 22, 2024
Messages
710
Gender
Male
HSC
2025
at what point do we start telling the 2025'ers who will come in a few months and ask if their atar is cooked, that they are actually cooked and the 'comeback' is almost impossible? i know at least someone will only decide to seek help right before/after trials, its inevitable
 

cristal

Well-Known Member
Joined
Oct 16, 2024
Messages
638
Gender
Female
HSC
2027
Patched together with bubblegum and popsicle sticks, found across the web
CHANNELS variable might have to be changed to match the device number connected to the computer
wow what's the code for :oldeek::oldeek:
also when you said bubblegum I thought you meant (a certain someone's) bubble gum sim 💀 💀
 

Tony Stark

Well-Known Member
Joined
Jan 22, 2025
Messages
408
Location
Where th4run is
Gender
Male
HSC
2025
wow what's the code for :oldeek::oldeek:
also when you said bubblegum I thought you meant (a certain someone's) bubble gum sim 💀 💀
Basically, it gets voice input and prompts an A.I, then the A.I returns a message. It is also inputed to a different A.I to output as sound, with somewhat natural voice. I think I changed a few things and it doesn't really work now, but it did a while back, also I used up all the free tokens from the A.I.
 

barnyard

Active Member
Joined
Apr 1, 2025
Messages
122
Gender
Male
HSC
2025
how do i write a 10/10 mod c reflection bruh 💔 🥀
like lowk im feeling confident with my piece but how do i even do an effective reflection that isnt just blatant self glaze
 

Study to success

Leader of the Anti HSC English Party
Joined
Sep 24, 2024
Messages
3,744
Location
#anti English hsc party headquarters
Gender
Female
HSC
2026
how do i write a 10/10 mod c reflection bruh 💔 🥀
like lowk im feeling confident with my piece but how do i even do an effective reflection that isnt just blatant self glaze
isn't a self reflection supposed to be a self glaze lmao. Cause the more u glaze ur writing u can potentially gaslight ur teacher into thinking ur writing is better than it actually is
 

Users Who Are Viewing This Thread (Users: 1, Guests: 14)

Top