<commit_before>/**
Khalid
*/
package org.sikuli.slides.media;

import java.io.File;
import java.io.IOException;
import javax.sound.sampled.UnsupportedAudioFileException;
import net.jsoundsystem.JSound;
import org.sikuli.slides.utils.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Sound {
	private static final Logger logger = (Logger) LoggerFactory.getLogger(Sound.class);
	private String name;
	private String fileName;
	private String relationshipId;
	
	public Sound(){
		
	}
	public Sound (String name, String fileName, String relationshipId){
		this.name=name;
		this.fileName=fileName;
		this.relationshipId=relationshipId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getRelationshipId() {
		return relationshipId;
	}
	public void setRelationshipId(String relationshipId) {
		this.relationshipId = relationshipId;
	}
	
	public void playSound(){
		String slideMediaLocation=Constants.projectDirectory+Constants.MEDIA_DIRECTORY+File.separator+getFileName();
		try {
			JSound sound = new JSound(slideMediaLocation);
			sound.play();
		}
		catch (UnsupportedAudioFileException e) {
			logger.error("Error in playing the audio file: Unsupported audio file format");
		} catch (IOException e) {
			logger.error("Error in playing the audio file: Failed I/O operation.");
		}
	}
	public String toString(){
		return "Sound info:\n" +"name:"+name+"\n file name:"+fileName+
				"\n relationshipID="+relationshipId;
	}
	
}<commit_msg>refactor Sound class<commit_after>/**
Khalid
*/
package org.sikuli.slides.media;

import java.io.File;
import java.io.IOException;
import javax.sound.sampled.UnsupportedAudioFileException;
import net.jsoundsystem.JSound;
import org.sikuli.slides.utils.Constants;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Sound {
	private static final Logger logger = (Logger) LoggerFactory.getLogger(Sound.class);
	private String name;
	private String fileName;
	private String relationshipId;
	
	public Sound(){
		
	}
	public Sound (String name, String fileName, String relationshipId){
		this.name=name;
		this.fileName=fileName;
		this.relationshipId=relationshipId;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getFileName() {
		return fileName;
	}
	public void setFileName(String fileName) {
		this.fileName = fileName;
	}
	public String getRelationshipId() {
		return relationshipId;
	}
	public void setRelationshipId(String relationshipId) {
		this.relationshipId = relationshipId;
	}
	
	public void playSound(){
		logger.info("Playing audio..");
		String slideMediaLocation = Constants.projectDirectory + Constants.MEDIA_DIRECTORY + File.separator + getFileName();
		try{
			JSound sound = new JSound(slideMediaLocation);
			sound.play();
		}
		catch (UnsupportedAudioFileException e) {
			logger.error("Error in playing the audio file: Unsupported audio file format");
		}
		catch (IOException e) {
			logger.error("Error in playing the audio file: Failed I/O operation.");
		}
	}
	
	public String toString(){
		return "Sound info:\n" +"name:"+name+"\n file name:"+fileName+
				"\n relationshipID="+relationshipId;
	}
	
}
{'fraction_non_alphanumeric': 0.10737463126843658, 'fraction_numerical': 0.0011799410029498525, 'mean_word_length': 4.776831345826235, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6432586', 'n_tokens_mistral': 1107, 'n_tokens_neox': 1046, 'n_words': 268}