Filter
Exclude
Time range
-
Near
Our #HeadToHead battle returned today in our #ReflectiveReading. It got very competitive! #Literacy #Competition #TextType #P7Team ๐Ÿ˜Š
7
202
3 Dec 2024
Broken COde is Excersise code Y W Here's an enhanced version of the `VideoContentCreator` class that incorporates the additional audio โ”‚ โ”‚ generation capabilities: โ”‚ โ”‚ โ”‚ โ”‚ ```python โ”‚ โ”‚ import os โ”‚ โ”‚ import json โ”‚ โ”‚ import logging โ”‚ โ”‚ import requests โ”‚ โ”‚ from typing import Dict, List โ”‚ โ”‚ from bs4 import BeautifulSoup โ”‚ โ”‚ from collections import Counter โ”‚ โ”‚ import pyttsx3 โ”‚ โ”‚ import moviepy.editor as mp โ”‚ โ”‚ import boto3 โ”‚ โ”‚ from contextlib import contextmanager โ”‚ โ”‚ from io import BytesIO โ”‚ โ”‚ from pathlib import Path โ”‚ โ”‚ โ”‚ โ”‚ class VideoContentCreator: โ”‚ โ”‚ """ โ”‚ โ”‚ A class to generate video content based on user input and preferences. โ”‚ โ”‚ โ”‚ โ”‚ Attributes: โ”‚ โ”‚ topic (str): The topic or theme of the video. โ”‚ โ”‚ content_style (str): The preferred content style (e.g., informative, entertaining). โ”‚ โ”‚ target_audience (str): The target audience for the video. โ”‚ โ”‚ duration (float): The desired duration of the video in minutes. โ”‚ โ”‚ output_format (str): The desired output format for the video script and audio (e.g., text, PDF, โ”‚ โ”‚ Markdown, mp3, wav). โ”‚ โ”‚ tts_engine (str): The text-to-speech engine to use (e.g., 'pyttsx3', 'aws_polly'). โ”‚ โ”‚ """ โ”‚ โ”‚ โ”‚ โ”‚ def __init__(self, topic: str, content_style: str, target_audience: str, duration: float, โ”‚ โ”‚ output_format: str, tts_engine: str = 'pyttsx3'): โ”‚ โ”‚ # Input validation (same as previous implementation) โ”‚ โ”‚ # ... โ”‚ โ”‚ โ”‚ โ”‚ self.topic = topic โ”‚ โ”‚ self.content_style = content_style โ”‚ โ”‚ self.target_audience = target_audience โ”‚ โ”‚ self.duration = duration โ”‚ โ”‚ self.output_format = output_format โ”‚ โ”‚ self.tts_engine = tts_engine โ”‚ โ”‚ โ”‚ โ”‚ # Set up logging โ”‚ โ”‚ logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s') โ”‚ โ”‚ โ”‚ โ”‚ def text_to_speech(self, script: str, voice_id: str = 'Joanna') -> str: โ”‚ โ”‚ """ โ”‚ โ”‚ Convert the generated video script into an audio file using text-to-speech. โ”‚ โ”‚ โ”‚ โ”‚ Args: โ”‚ โ”‚ script (str): The generated video script. โ”‚ โ”‚ voice_id (str, optional): The ID of the voice to use for the text-to-speech. Defaults to โ”‚ โ”‚ 'Joanna'. โ”‚ โ”‚ โ”‚ โ”‚ Returns: โ”‚ โ”‚ The path to the generated audio file. โ”‚ โ”‚ """ โ”‚ โ”‚ logging.info("Generating audio from the video script using text-to-speech.") โ”‚ โ”‚ try: โ”‚ โ”‚ if self.tts_engine == 'pyttsx3': โ”‚ โ”‚ engine = pyttsx3.init() โ”‚ โ”‚ engine.setProperty('rate', 150) โ”‚ โ”‚ engine.setProperty('volume', 0.8) โ”‚ โ”‚ audio_path = os.path.join("output", "video_audio.mp3") โ”‚ โ”‚ engine.save_to_file(script, audio_path) โ”‚ โ”‚ engine.runAndWait() โ”‚ โ”‚ elif self.tts_engine == 'aws_polly': โ”‚ โ”‚ polly = boto3.client('polly') โ”‚ โ”‚ response = polly.synthesize_speech( โ”‚ โ”‚ Text=script, โ”‚ โ”‚ VoiceId=voice_id, โ”‚ โ”‚ OutputFormat='mp3', โ”‚ โ”‚ SampleRate='22050', โ”‚ โ”‚ TextType='ssml' โ”‚ โ”‚ ) โ”‚ โ”‚ audio_path = os.path.join("output", "video_audio.mp3") โ”‚ โ”‚ with open(audio_path, 'wb') as f: โ”‚ โ”‚ f.write(response['AudioStream'].read()) โ”‚ โ”‚ else: โ”‚ โ”‚ raise ValueError(f"Invalid TTS engine: {self.tts_engine}") โ”‚ โ”‚ โ”‚ โ”‚ logging.info(f"Audio file generated: {audio_path}") โ”‚ โ”‚ return audio_path โ”‚ โ”‚ except Exception as e: โ”‚ โ”‚ logging.error(f"Error during text-to-speech conversion: {e}") โ”‚ โ”‚ return "" โ”‚ โ”‚ โ”‚ โ”‚ def voice_cloning(self, script: str, source_voice_id: str, target_voice_id: str) -> str: โ”‚ โ”‚ """ โ”‚ โ”‚ Create a custom voice for the video script using voice cloning. โ”‚ โ”‚ โ”‚ โ”‚ Args: โ”‚ โ”‚ script (str): The generated video script. โ”‚ โ”‚ source_voice_id (str): The ID of the source voice to clone. โ”‚ โ”‚ target_voice_id (str): The ID of the target voice to create. โ”‚ โ”‚ โ”‚ โ”‚ Returns: โ”‚ โ”‚ The path to the generated audio file with the custom voice. โ”‚ โ”‚ """ โ”‚ โ”‚ logging.info("Creating a custom voice for the video script using voice cloning.") โ”‚ โ”‚ try: โ”‚ โ”‚ polly = boto3.client('polly') โ”‚ โ”‚ response = polly.create_voice_id( โ”‚ โ”‚ SourceVoiceId=source_voice_id, โ”‚ โ”‚ TargetVoiceId=target_voice_id, โ”‚ โ”‚ OutputFormat='mp3', โ”‚ โ”‚ Text=script โ”‚ โ”‚ ) โ”‚ โ”‚ audio_path = os.path.join("output", "video_audio_custom_voice.mp3") โ”‚ โ”‚ with open(audio_path, 'wb') as f: โ”‚ โ”‚ f.write(response['AudioStream'].read()) โ”‚ โ”‚ logging.info(f"Custom voice audio file generated: {audio_path}") โ”‚ โ”‚ return audio_path โ”‚ โ”‚ except Exception as e: โ”‚ โ”‚ logging.error(f"Error during voice cloning: {e}") โ”‚ โ”‚ return "" โ”‚ โ”‚ โ”‚ โ”‚ def audio_post_processing(self, audio_path: str) -> str: โ”‚ โ”‚ """ โ”‚ โ”‚ Apply audio post-processing techniques to the generated audio file. โ”‚ โ”‚ โ”‚ โ”‚ Args: โ”‚ โ”‚ audio_path (str): The path to the generated audio file. โ”‚ โ”‚ โ”‚ โ”‚ Returns: โ”‚ โ”‚ The path to the processed audio file. โ”‚ โ”‚ """ โ”‚ โ”‚ logging.info("Applying audio post-processing to the generated audio file.") โ”‚ โ”‚ try: โ”‚ โ”‚ audio = mp.AudioFileClip(audio_path) โ”‚ โ”‚ # Apply audio normalization โ”‚ โ”‚ normalized_audio = mp.CompositeAudioClip() โ”‚ โ”‚ # Apply noise reduction โ”‚ โ”‚ denoised_audio = โ”‚ โ”‚ normalized_audio.without_audio().set_audio(normalized_audio.to_soundarray(fps=44100, nbytes=2, โ”‚ โ”‚ buffersize=5000).astype('int16')) โ”‚ โ”‚ # Apply equalization โ”‚ โ”‚ equalized_audio = denoised_audio.set_audio(denoised_audio.to_soundarray(fps=44100, nbytes=2, โ”‚ โ”‚ buffersize=5000).astype('int16')) โ”‚ โ”‚ processed_audio_path = os.path.join("output", "video_audio_processed.mp3") โ”‚ โ”‚ equalized_audio.write_audiofile(processed_audio_path) โ”‚ โ”‚ logging.info(f"Processed audio file generated: {processed_audio_path}") โ”‚ โ”‚ return processed_audio_path โ”‚ โ”‚ except Exception as e: โ”‚ โ”‚ logging.error(f"Error during audio post-processing: {e}") โ”‚ โ”‚ return audio_path โ”‚ โ”‚ โ”‚ โ”‚ def add_background_music(self, audio_path: str, music_path: str) -> str: โ”‚ โ”‚ """ โ”‚ โ”‚ Add background music to the generated audio file. โ”‚ โ”‚ โ”‚ โ”‚ Args: โ”‚ โ”‚ audio_path (str): The path to the generated audio file. โ”‚ โ”‚ music_path (str): The path to the background music file. โ”‚ โ”‚ โ”‚ โ”‚ Returns: โ”‚ โ”‚ The path to the audio file with the added background music. โ”‚ โ”‚ """ โ”‚ โ”‚ logging.info("Adding background music to the audio file.") โ”‚ โ”‚ try: โ”‚ โ”‚ video_audio = mp.AudioFileClip(audio_path) โ”‚ โ”‚ music_audio = mp.AudioFileClip(music_path) โ”‚ โ”‚ final_audio = mp.CompositeAudioClip() โ”‚ โ”‚ output_path = os.path.join("output", "video_with_music.mp3") โ”‚ โ”‚ final_audio.write_audiofile(output_path) โ”‚ โ”‚ logging.info(f"Audio file with background music generated: {output_path}") โ”‚ โ”‚ return output_path โ”‚ โ”‚ except Exception as e: โ”‚ โ”‚ logging.error(f"Error during background music addition: {e}") โ”‚ โ”‚ return audio_path โ”‚ โ”‚ โ”‚ โ”‚ def export_script_and_audio(self, script: str, audio_path: str, timestamps_and_scenes: Dict[str, โ”‚ โ”‚ List], metadata: Dict, output_dir: str = "output") -> None: โ”‚ โ”‚ """ โ”‚ โ”‚ Export the video script and audio to the desired output format. โ”‚ โ”‚ โ”‚ โ”‚ Args: โ”‚ โ”‚ script (str): The generated video script. โ”‚ โ”‚ audio_path (str): The path to the generated audio file. โ”‚ โ”‚ timestamps_and_scenes (dict): A dictionary containing the timestamps and scene descriptions. โ”‚ โ”‚ metadata (dict): A dictionary containing the video metadata. โ”‚ โ”‚ output_dir (str, optional): The directory to save the output file. Defaults to "output". โ”‚ โ”‚ """ โ”‚ โ”‚ # Implement export logic (same as previous implementation) โ”‚ โ”‚ # ... โ”‚ โ”‚ โ”‚ โ”‚ def generate_video_content(self) -> None: โ”‚ โ”‚ """ โ”‚ โ”‚ Orchestrate the entire video content generation process, including audio generation. โ”‚ โ”‚ """ โ”‚ โ”‚ research_data = self.content_research() โ”‚ โ”‚ keywords = self.keyword_extraction(research_data) โ”‚ โ”‚ script = self.script_generation(research_data) โ”‚ โ”‚ timestamps_and_scenes = self.generate_timestamps_and_scenes(script) โ”‚ โ”‚ metadata = self.generate_metadata(script, keywords) โ”‚ โ”‚ โ”‚ โ”‚ if self.tts_engine == 'pyttsx3': โ”‚ โ”‚ audio_path = self.text_to_speech(script) โ”‚ โ”‚ elif self.tts_engine == 'aws_polly': โ”‚ โ”‚ audio_path = self.text_to_speech(script, voice_id='Joanna') โ”‚ โ”‚ # audio_path = self.voice_cloning(script, 'Joanna', 'custom_voice_id') โ”‚ โ”‚ else: โ”‚ โ”‚ raise ValueError(f"Invalid TTS engine: {self.tts_engine}") โ”‚ โ”‚ โ”‚ โ”‚ audio_path = self.audio_post_processing(audio_path) โ”‚ โ”‚ audio_path = self.add_background_music(audio_path, "path/to/background_music.mp3") โ”‚ โ”‚ self.export_script_and_audio(script, audio_path, timestamps_and_scenes, metadata) โ”‚ โ”‚ ``` โ”‚ โ”‚

1
36
N-noโ€ฆ.. noโ€ฆโ€ฆ.. heโ€ฆโ€ฆ he has a pointโ€ฆโ€ฆ. The Dingaling-style texttypeโ€ฆโ€ฆ is bound toโ€ฆ.. become lost mediaโ€ฆโ€ฆโ€ฆ
1
22
ใฉใ†ใ‚„ใ‚‰URLใ‚ซใƒฉใƒ ใซEmailใจใ‚„ๅฝน่ทๅใชใ‚“ใ‹ใ‚’ๅ…ฅใ‚Œใ‚ˆใ†ใจใ—ใฆใŸใ‚‰ใ—ใใ€ใ€Œใ“ใ‚ŒURLใ˜ใ‚ƒใชใ„ใ‚“ใ ใ‘ใฉโ€ฆใ€ใฃใฆใ„ใ†ใ‚จใƒฉใƒผใซใชใฃใฆใŸใฟใŸใ„ URLใ‚’TextTypeใซใ™ใ‚‹ใจใ‚จใƒฉใƒผใฏ็„กใใชใ‚‹ใŒโ€ฆ ใ†๏ฝžใ‚“โ€ฆ
2
2
106
And while I'm admittedly biased since I prefer the Byz texttype, I do think the way NKJV handles variants is significantly and objectively better. Give us the traditional reading in the main text, and then give a clear and factual footnote regarding variants down below. 2/2
17
Y5 have started a new text type this morning which can only mean one thing... WAGOLL analysis time! โœ๏ธ๐Ÿ” #Writing #texttype #WAGOLL #learninglovinggrowing
4
206
No TextType in Hibernate 6 but @belyaev_andrey has solutions: jpa-buddy.com/blog/how-to-stโ€ฆ

2
2
212
The MAUI Label control has a property to set a TextType as Html but that acts weird for me on Windows and with some simple HTML samples makes the whole app crash away: stackoverflow.com/questions/โ€ฆ. Even wondered whether it would want well-formed XML but now found malformed <br> ok.

1
2
This 1994 DTS PhD diss by Timothy Ralston, "The Majority Text and Byzantine texttype development," is hardly cited according to Google Scholar but it's a devastating demonstration that the majority text is not just a Byzantine text but a late phase of it. proquest.com/docview/3041520โ€ฆ

3
4
Im the paragrapher lol ๐Ÿ˜‚ Tell me which one โ˜๐Ÿพare you? Tag a friend and tell them who h one you think they are! Have fun! #texttype #howdoyoutext #texting #textingpersonality #teatext #botanicallyblended instagram.com/p/CfkiITnsTI7/โ€ฆ

1
1
#dailymaxseq ไปŠๆ—ฅใฏใ€Œtexttypeใ€ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ไฝฟใฃใฆใƒฆใƒผใ‚ฏใƒชใƒƒใƒ‰ใ‚ทใƒผใ‚ฑใƒณใ‚ตใƒผใ‚’ใ‚ณใƒณใƒˆใƒญใƒผใƒซใ—ใฆ้Šใ‚“ใ ใ€‚ ใคใ„ใงใซใ“ใ‚Œใ‚‚FMใ‚ทใƒณใ‚ปใง้Ÿณใ‚’ไฝœใฃใŸใ‘ใฉใ€Maxใ‹ใ‚‰MIDI CCใ‚’้€ใฃใฆใƒ‘ใƒฉใƒกใƒผใ‚ฟใƒผใ‚’ใ„ใ˜ใ‚‹ใ‚„ใคใ‚„ใ‚ŠใŸใใชใฃใฆใใŸใ€‚ #ableton #maxmsp #DTMerใจ็น‹ใŒใ‚ŠใŸใ„ #creativecoding
3
15
I think I wrote this when I was going through a stage of purposefully dropping out essential vowels so the word was shorter #texttype Got me prepared for shorthand mind
1
ใ‚ฟใ‚คใƒ—ใƒฉใ‚คใ‚ฟใƒผใ‚’ๅˆถๅพกใ™ใ‚‹ๅ‡ฆ็†ใฏใ“ใ‚Œใงใ™ If(Len(TextInput1.Text)>StringCnt, Set(texttype,Mid(TextInput1.Text,1,StringCnt)); Set(StringCnt,StringCnt 1),"")
ใ ใ‚Œใ ๏ผŸ #PowerApps ใฏใ‚ขใƒ‹ใƒกใƒผใ‚ทใƒงใƒณ็š„ใช่กจ็พใŒใงใใชใ„ใจใฌใ‹ใ—ใŸๅฅดใฏใ€‚ ใ‚ฟใ‚คใƒ—ใƒฉใ‚คใ‚ฟใƒผใใ‚‰ใ„ใชใ‚‰ๆœ้ฃฏๅ‰ใ ใœ
1
3
4
24 Oct 2019
i think my next post will be a texttype for gus dapperton's coax and botany
8
New #XamarinForms 4.3-pre1 with Html TextType... and it works @"<span style=""color:blue;background:yellow"">This is a Blue Heading</span>";
4
15
Replying to @davidortinau
And Label with HTML TextType...
2
Craig introduces the new Doorway Online TextType 3 Practice Workbook and reflects on his experiences of learning to touch type - and the ultimate benefits. callscotland.org.uk/blog/dooโ€ฆ
1
4
1
What are your most valued Doorway activities? We have updated Cashing In and TextType. With Glasgow Uni, we are working on replacements for First Sounds, Words, Blends and Letter Formation. Next? Your choice? Ideas for small improvements to activities? That would really help.
2
3