What Am I doing Wrong Here

OK I have tried numerous ways to convert this blasted thing to use the new UI text what the heck am I missing here?

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

//[RequireComponent(typeof(AudioSource))]
//[RequireComponent(typeof(GUITexture))]
public class AudioWaveFormVisualizer : MonoBehaviour
{

	public AudioSource MusicPlayer;
	public int width = 500; // texture width 
	public int height = 100; // texture height 
	public Color backgroundColor = Color.black; 
	public Color waveformColor = Color.green; 
	public int size = 2048; // size of sound segment displayed in texture

	private Color[] blank; // blank image array 
	public Texture2D Texture;
	private float[] samples; // audio samples array

	IEnumerator Start ()
	{ 

		// create the samples array 
		samples = new float; 

		// create the texture and assign to the guiTexture: 
		//texture = new Texture2D (width, height);
		Texture = new Texture();

		//GetComponent<GUITexture>().texture = texture;
		Texture2D.texture = Texture;

		// create a 'blank screen' image 
		blank = new Color[width * height]; 

		for (int i = 0; i < blank.Length; i++) { 
			blank  *= backgroundColor;* 
  •  }* 
    
  •  // refresh the display each 100mS* 
    
  •  while (true) {*
    
  •  	GetCurWave ();* 
    
  •  	yield return new WaitForSeconds (0.1f);* 
    
  •  }* 
    
  • }*

  • void GetCurWave ()*

  • {*

  •  // clear the texture* 
    
  •  Texture.SetPixels (blank, 0);*
    
  •  // get samples from channel 0 (left)* 
    
  •  MusicPlayer.GetOutputData (samples, 0);* 
    
  •  // draw the waveform* 
    
  •  for (int i = 0; i < size; i++) {* 
    

_ Texture.SetPixel ((int)(width * i / size), (int)(height * (samples + 1f) / 2f), waveformColor);_

* } // upload to the graphics card*

* Texture.Apply ();*
* }*
}

This solved the issue!

using UnityEngine;
using UnityEngine.UI;
using System.Collections;

public class AudioWaveFormVisualizer : MonoBehaviour
{
	public AudioSource MusicPlayer;
	public int width = 305; // texture width 
	public int height = 234; // texture height 
	public Color backgroundColor = Color.black; 
	public Color waveformColor = Color.green; 
	public int size = 2048; // size of sound segment displayed in texture

	private Color[] blank; // blank image array 
	private Texture2D rawimage;
	public RawImage Texture2D;
	private float[] samples; // audio samples array

	IEnumerator Start ()
	{ 
		// create the samples array 
		samples = new float; 
		// create the texture and assign to the guiTexture: 
		rawimage = new Texture2D (width, height);
		GetComponent<RawImage>().texture = rawimage; 
		// create a 'blank screen' image 
		blank = new Color[width * height]; 
		for (int i = 0; i < blank.Length; i++) { 
			blank  *= backgroundColor;* 
  •  }* 
    
  •  // refresh the display each 100mS* 
    
  •  while (true) {*
    
  •  	GetCurWave ();* 
    
  •  	yield return new WaitForSeconds (0.1f);* 
    
  •  }* 
    
  • }*

  • void GetCurWave ()*

  • {*

  •  // clear the texture* 
    
  •  rawimage.SetPixels (blank, 0);*
    
  •  // get samples from channel 0 (left)* 
    
  •  MusicPlayer.GetOutputData (samples, 0);* 
    
  •  // draw the waveform* 
    
  •  for (int i = 0; i < size; i++) {* 
    

_ rawimage.SetPixel ((int)(width * i / size), (int)(height * (samples + 1f) / 2f), waveformColor);_
* } // upload to the graphics card*
* rawimage.Apply ();*
* }*
}